samvera-deprecated / curation_concerns

A Hydra-based Rails Engine that extends an application, adding the ability to Create, Read, Update and Destroy (CRUD) objects (based on Hydra::Works) and providing a generator for defining object types with custom workflows, views, access controls, etc.
Other
15 stars 27 forks source link

jobs: lock FileSets while attaching Files #1169

Closed dunn closed 7 years ago

dunn commented 7 years ago

Currently

actor = CurationConcerns::Actors::FileSetActor.new(file_set, user)
actor.create_content('file1')
actor.create_content('file2', 'restored')

Can fail due to background jobs trying to create and/or modify the FileSet at the same time. See e.g. https://gist.github.com/anonymous/1f8160b427359cf913dd0f25730cf155

@projecthydra/sufia-code-reviewers

dunn commented 7 years ago

If this gets merged I'd like to see it backported to the stable branches as well.

dunn commented 7 years ago

One failure, only on Rails 5:

  1) curation_concerns/admin/workflow_roles/index.html.erb with no users having workflow roles displays "No Roles" for each user

     Failure/Error: expect(rendered).to have_content('No roles', count: 2)

       expected to find text "No roles" 2 times but found 3 times in "User Roles email-264559026141571143238804955573739943184@test.com No roles email-214583786020988702169824748549956437353@test.com No roles email-168239347964861174172859161436173490259@test.com No roles Grant a role to a user: User requiredemail-264559026141571143238804955573739943184@test.comemail-214583786020988702169824748549956437353@test.comemail-168239347964861174172859161436173490259@test.com Workflow role required"

     # ./spec/views/curation_concerns/admin/workflow_roles/index.html.erb_spec.rb:18:in `block (3 levels) in <top (required)>'

https://travis-ci.org/projecthydra/curation_concerns/jobs/214001946#L1770

Not sure how that could have been caused by this. Maybe it's a flaky spec?

jcoyne commented 7 years ago

@dunn I restarted that job, I think it's a flaky spec.

dunn commented 7 years ago

🍏 now.

dunn commented 7 years ago

Thanks! Should I open PRs against 1-7-stable and 1-6-stable, or would you rather just cherry-pick?

mjgiarlo commented 7 years ago

@dunn If you don't mind whipping up PRs against those branches, that'd be swell. Thank you for working on this!