ExclusiveLease error in spec/features/merge_request/user_closes_reopens_merge_request_state_spec.rb
The problem
The spec/features/merge_request/user_closes_reopens_merge_request_state_spec.rb
spec is sometimes timing out CI/CD jobs with the following error:
when closed
when clicking the bottom `Reopen merge request` button
DEPRECATION WARNING: using BatchLoader.for in GraphQL is deprecated. Use BatchLoader::GraphQL.for instead or return BatchLoader::GraphQL.wrap from your resolver.
2025-01-23 19:03:02 +0000 Rack app ("GET /namespace83/project-83/-/merge_requests/1/widget.json" - (127.0.0.1)): #<Gitlab::ExclusiveLease::LeaseWithinTransactionError: Exclusive lease cannot be obtained within a transaction as it could lead to idle transactions.>
WARN: Screenshot could not be saved. `page.current_path` is empty.
WARNING: step_script could not run to completion because the timeout was exceeded. For more control over job and script timeouts see: https://docs.gitlab.com/ee/ci/runners/configure_runners.html#set-script-and-after_script-timeouts
ERROR: Job failed: execution took longer than 1h30m0s seconds
It seems that once this error happens, the CI/CD job is stuck until it times out.
2025-01-23 19:03:02 +0000 Rack app ("GET /namespace83/project-83/-/merge_requests/1/widget.json" - (127.0.0.1)): #<Gitlab::ExclusiveLease::LeaseWithinTransactionError: Exclusive lease cannot be obtained within a transaction as it could lead to idle transactions.>
Examples:
Edited by David Dieulivol