Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flaky GraduationJob tests #2185

Merged
merged 1 commit into from
Oct 13, 2021
Merged

Fix flaky GraduationJob tests #2185

merged 1 commit into from
Oct 13, 2021

Conversation

mark-dce
Copy link
Contributor

@mark-dce mark-dce commented Oct 13, 2021

All tests in the GraduationJob test group are periodically failing
with the same error:

ActiveRecord::RecordNotFound:
  Couldn't find Hyrax::PermissionTemplate
./lib/workflow_setup.rb:156:in `block in everyone_can_deposit_everywhere'
./lib/workflow_setup.rb:154:in `everyone_can_deposit_everywhere'
./lib/workflow_setup.rb:44:in `setup'
./spec/jobs/graduation_job_with_embargo_spec.rb:46:in `block (3 levels) in <top (required)>'

See an example at https://app.circleci.com/pipelines/github/curationexperts/laevigata/504/workflows/bd115b16-c926-461a-b739-cb9c864d3763/jobs/536/tests#failed-test-0

This failure is occuring in the workflow setup called in the before block
for the test group. It appears that depending on the randomized order of other
tests, the AdminSets and Workflow may be left in a state incompatible with
the workflow setup for this test group, causing the setup to silently fail.

Explicitly resetting Fedora to a clean state allows the workflow setup
to run successfully and leave Workflows in the state expected by
the rest of the test group.

All tests in the GraduationJob test group are periodically failing
with the same error:
```
ActiveRecord::RecordNotFound:
  Couldn't find Hyrax::PermissionTemplate
./lib/workflow_setup.rb:156:in `block in everyone_can_deposit_everywhere'
./lib/workflow_setup.rb:154:in `everyone_can_deposit_everywhere'
./lib/workflow_setup.rb:44:in `setup'
./spec/jobs/graduation_job_with_embargo_spec.rb:46:in `block (3 levels) in <top (required)>'
```

This failure is occuring in the workflow setup called in the `before` block
for the test group.  It appears that depending on the randomized order of other
tests, the AdminSets and Workflow may be left in a state incompatible with
the workflow setup for this test group, causing the setup to silently fail.

Explicitly resetting Fedora to a clean state allows the workflow setup
to run successfully and leave Workflows in the state expected by
the rest of the test group.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 92.023% when pulling 0d6e6b5 on fix_flaky_tests into 78d74b0 on main.

@mlooney mlooney merged commit 83aefa7 into main Oct 13, 2021
@mlooney mlooney deleted the fix_flaky_tests branch October 13, 2021 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants