Skip to content

Commit

Permalink
Fix flaky GraduationJob tests (#2185)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mark-dce authored Oct 13, 2021
1 parent 78d74b0 commit 83aefa7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions spec/jobs/graduation_job_with_embargo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
}

before :all do
ActiveFedora::Cleaner.clean!
WorkflowSetup.new("#{fixture_path}/config/emory/superusers.yml", "#{fixture_path}/config/emory/candler_admin_sets.yml", "/dev/null").setup
end

Expand Down

0 comments on commit 83aefa7

Please sign in to comment.