Skip to content

Fix spec that introduces transaction timeout on Ruby 3.0.2

What does this MR do?

This is extracted from Ruby 3.0.2 branch.
These specs are having a timeout on Ruby 3.0.2 while working just fine on Ruby 2.7.

Rewriting the way how we obtain a separate connection (via a dedicated API instead of stubbing the const) resolves the issue.

Although I am not sure I understand the very root cause of the issue, so database expert help would be appreciated a lot.

How to setup and validate locally (strongly suggested)

Switch to Ruby **3.0.2 **in GDK.
Run bin/spring rspec spec/lib/gitlab/database/with_lock_retries_outside_transaction_spec.rb or/and bin/spring rspec spec/lib/gitlab/database/with_lock_retries_outside_transaction_spec.rb. They would be stuck on master after executing this line https://gitlab.com/gitlab-org/gitlab/-/blob/master/spec/lib/gitlab/database/with_lock_retries_outside_transaction_spec.rb#L190.

Applying the fixes on this branch, you are able to run the spec both on Ruby 3 on Ruby 2.7.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

N/A - it's a spec

Security

N/A

Edited by Aleksei Lipniagov

Merge request reports

Loading