Broken master in migration specs

This happens in several specs:

 rspec './spec/lib/gitlab/background_migration/backfill_legacy_project_repositories_spec.rb[1:1:1:1]' # Gitlab::BackgroundMigration::BackfillLegacyProjectRepositories behaves like backfill migration for project repositories #perform creates a project_repository row for projects on legacy storage that needs one
rspec './spec/lib/gitlab/background_migration/backfill_legacy_project_repositories_spec.rb[1:1:1:2]' # Gitlab::BackgroundMigration::BackfillLegacyProjectRepositories behaves like backfill migration for project repositories #perform does nothing for projects on legacy storage that have already a project_repository row
rspec './spec/lib/gitlab/background_migration/backfill_legacy_project_repositories_spec.rb[1:1:1:3]' # Gitlab::BackgroundMigration::BackfillLegacyProjectRepositories behaves like backfill migration for project repositories #perform does nothing for projects on hashed storage
rspec './spec/lib/gitlab/background_migration/backfill_legacy_project_repositories_spec.rb[1:1:1:4]' # Gitlab::BackgroundMigration::BackfillLegacyProjectRepositories behaves like backfill migration for project repositories #perform inserts rows in a single query
SimpleCov failed with exit 1
rspec ./spec/lib/gitlab/background_migration/remove_restricted_todos_spec.rb:39 # Gitlab::BackgroundMigration::RemoveRestrictedTodos when a project is private removes todos of users without project access
rspec ./spec/lib/gitlab/background_migration/remove_restricted_todos_spec.rb:44 # Gitlab::BackgroundMigration::RemoveRestrictedTodos when a project is private with a confidential issue removes todos of users without project access and guests for confidential issues
rspec ./spec/lib/gitlab/background_migration/remove_restricted_todos_spec.rb:62 # Gitlab::BackgroundMigration::RemoveRestrictedTodos when a project is public when all features have the same visibility as the project, no confidential issues does not remove any todos
rspec ./spec/lib/gitlab/background_migration/remove_restricted_todos_spec.rb:81 # Gitlab::BackgroundMigration::RemoveRestrictedTodos when a project is public with confidential issues removes confidential issue todos for non authorized users
rspec ./spec/lib/gitlab/background_migration/remove_restricted_todos_spec.rb:98 # Gitlab::BackgroundMigration::RemoveRestrictedTodos when a project is public features visibility restrictions when issues are restricted to project members removes non members issue todos
rspec ./spec/lib/gitlab/background_migration/remove_restricted_todos_spec.rb:108 # Gitlab::BackgroundMigration::RemoveRestrictedTodos when a project is public features visibility restrictions when merge requests are restricted to project members removes non members issue todos
rspec ./spec/lib/gitlab/background_migration/remove_restricted_todos_spec.rb:118 # Gitlab::BackgroundMigration::RemoveRestrictedTodos when a project is public features visibility restrictions when repository and merge requests are restricted to project members removes non members commit and merge requests todos
rspec ./ee/spec/migrations/migrate_epic_notes_mentions_to_db_spec.rb:35 # epic notes mentions migration RemigrateEpicNotesMentionsToDb behaves like schedules resource mentions migration schedules background migrations

The error looks like this:

     # ------------------
     # --- Caused by: ---
     # PG::LockNotAvailable:
     #   ERROR:  canceling statement due to lock timeout
     #   ./vendor/ruby/2.6.0/gems/activerecord-6.0.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:92:in `exec'
Edited by Bob Van Landuyt