Skip to content

Disable transactions in check_rake_spec.rb

Stan Hu requested to merge sh-fix-issue-432194 into master

What does this MR do and why?

Previously this was happening:

  1. TestProf/DbCleaner starts a transaction.
  2. SystemCheck::App::TableTruncateCheck uses that connection to run SELECT EXISTS for all tables.
  3. The connection idles in transaction.
  4. SystemCheck::App::MigrationsAreUpCheck attempts to run rake db:migrate:status, but the database is deadlocked due to the transaction..

We can add the :delete in the test metadata to avoid using a transaction.

Relates to #432194 (closed)

How to set up and validate locally

SKIP_DATABASE_CONFIG_VALIDATION=true FOSS_ONLY=1 bin/rspec -f d spec/lib/gitlab/background_migration/backfill_prepared_at_merge_requests_spec.rb spec/tasks/gitlab/check_rake_spec.rb

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Stan Hu

Merge request reports