Resolve flaky behaviour during local rspec for spec/graphql/mutations/design_management/upload_spec.rb
When running bin/rspec spec/graphql/mutations/design_management/upload_spec.rb
locally, the FailedToObtainLockError
occurs. This does not occur in the CI pipeline.
1) Mutations::DesignManagement::Upload#resolve when the feature is available contention in the design repo running requests in parallel does not cause errors
Failure/Error: expect(&block).not_to raise_error
expected no Exception, got #<Gitlab::ExclusiveLeaseHelpers::FailedToObtainLockError: Failed to obtain a lock> with backtrace:
# ./lib/gitlab/exclusive_lease_helpers/sleeping_lock.rb:19:in `obtain'
# ./lib/gitlab/exclusive_lease_helpers.rb:36:in `in_lock'
# ./app/models/design_management/version.rb:108:in `with_lock'
# ./app/services/design_management/save_designs_service.rb:38:in `upload_designs!'
# ./app/services/design_management/save_designs_service.rb:22:in `execute'
# ./ee/app/services/ee/design_management/save_designs_service.rb:10:in `execute'
This was found to be caused by the high levels of concurrency when run locally compared to 2
in the CI pipeline. Explained in !145488 (comment 1822907124).