Master broken: Order dependent failure in ./spec/lib/gitlab/doctor/secrets_spec.rb
This is from !21851 (merged). I suspect there is some spec leakage caused by https://gitlab.com/gitlab-org/gitlab/blob/150901e1a5220a274d7451e26940558ff288fa0f/spec/models/concerns/bulk_insert_safe_spec.rb#L57-67.
From https://gitlab.com/gitlab-org/gitlab/-/jobs/594172159:
Failures:
1) Gitlab::Doctor::Secrets when encrypted attributes are properly set detects decryptable secrets
Failure/Error:
model.find_each do |data|
attributes.each do |att|
failures_per_row[data.id] << att unless valid_attribute?(data, att)
end
end
ActiveRecord::StatementInvalid:
PG::UndefinedTable: ERROR: relation "bulk_insert_items" does not exist
LINE 1: SELECT "bulk_insert_items".* FROM "bulk_insert_items" ORDER ...
^
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/postgresql_adapter.rb:675:in `exec_params'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/postgresql_adapter.rb:675:in `block (2 levels) in exec_no_cache'
# ./vendor/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
# ./vendor/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
# ./vendor/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/postgresql_adapter.rb:674:in `block in exec_no_cache'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract_adapter.rb:722:in `block (2 levels) in log'
# ./vendor/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
# ./vendor/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
# ./vendor/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
# ./vendor/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
# ./vendor/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract_adapter.rb:721:in `block in log'
# ./vendor/ruby/2.6.0/gems/activesupport-6.0.3.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract_adapter.rb:712:in `log'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/postgresql_adapter.rb:673:in `exec_no_cache'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/postgresql_adapter.rb:654:in `execute_and_clear'
# ./vendor/ruby/2.6.0/gems/marginalia-1.8.0/lib/marginalia.rb:94:in `execute_and_clear_with_marginalia'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:98:in `exec_query'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract/database_statements.rb:489:in `select'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract/database_statements.rb:70:in `select_all'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract/query_cache.rb:107:in `select_all'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/querying.rb:46:in `find_by_sql'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/relation.rb:821:in `block in exec_queries'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/relation.rb:836:in `block in skip_query_cache_if_necessary'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/abstract/query_cache.rb:79:in `uncached'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/query_cache.rb:21:in `uncached'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/relation/delegation.rb:66:in `block in uncached'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/relation.rb:407:in `block in scoping'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/relation.rb:784:in `_scoping'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/relation.rb:407:in `scoping'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/relation/delegation.rb:66:in `uncached'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/relation.rb:835:in `skip_query_cache_if_necessary'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/relation.rb:808:in `exec_queries'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/relation.rb:626:in `load'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/relation.rb:250:in `records'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/relation/batches.rb:224:in `block in in_batches'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/relation/batches.rb:222:in `loop'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/relation/batches.rb:222:in `in_batches'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/relation/batches.rb:135:in `find_in_batches'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/relation/batches.rb:69:in `find_each'
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/querying.rb:21:in `find_each'
# ./lib/gitlab/doctor/secrets.rb:38:in `block in check_model_attributes'
# ./lib/gitlab/doctor/secrets.rb:36:in `each'
# ./lib/gitlab/doctor/secrets.rb:36:in `check_model_attributes'
# ./lib/gitlab/doctor/secrets.rb:26:in `run!'
# ./spec/lib/gitlab/doctor/secrets_spec.rb:10:in `block (2 levels) in <top (required)>'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/memoized_helpers.rb:317:in `block (2 levels) in let'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/memoized_helpers.rb:157:in `block (3 levels) in fetch_or_store'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/memoized_helpers.rb:157:in `fetch'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/memoized_helpers.rb:157:in `block (2 levels) in fetch_or_store'
# ./vendor/ruby/2.6.0/gems/rspec-support-3.9.2/lib/rspec/support/reentrant_mutex.rb:23:in `synchronize'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/memoized_helpers.rb:156:in `block in fetch_or_store'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/memoized_helpers.rb:155:in `fetch'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/memoized_helpers.rb:155:in `fetch_or_store'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/memoized_helpers.rb:317:in `block in let'
# ./spec/lib/gitlab/doctor/secrets_spec.rb:17:in `block (3 levels) in <top (required)>'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:257:in `instance_exec'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:257:in `block in run'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:503:in `block in with_around_and_singleton_context_hooks'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:460:in `block in with_around_example_hooks'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/hooks.rb:472:in `block in run'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/hooks.rb:612:in `block in run_around_example_hooks_for'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:345:in `call'
# ./vendor/ruby/2.6.0/gems/rspec-rails-4.0.0/lib/rspec/rails/adapters.rb:75:in `block (2 levels) in <module:MinitestLifecycleAdapter>'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:450:in `instance_exec'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:450:in `instance_exec'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/hooks.rb:381:in `execute_with'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/hooks.rb:614:in `block (2 levels) in run_around_example_hooks_for'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:345:in `call'
# ./spec/spec_helper.rb:308:in `block (3 levels) in <top (required)>'
# ./vendor/ruby/2.6.0/gems/sidekiq-5.2.7/lib/sidekiq/testing.rb:55:in `server_middleware'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:299:in `block (2 levels) in <top (required)>'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:450:in `instance_exec'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:450:in `instance_exec'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/hooks.rb:381:in `execute_with'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/hooks.rb:614:in `block (2 levels) in run_around_example_hooks_for'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:345:in `call'
# ./spec/spec_helper.rb:295:in `block (3 levels) in <top (required)>'
# ./vendor/ruby/2.6.0/gems/gitlab-labkit-0.12.0/lib/labkit/context.rb:32:in `with_context'
# ./spec/spec_helper.rb:295:in `block (2 levels) in <top (required)>'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:450:in `instance_exec'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:450:in `instance_exec'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/hooks.rb:381:in `execute_with'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/hooks.rb:614:in `block (2 levels) in run_around_example_hooks_for'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:345:in `call'
# ./vendor/ruby/2.6.0/gems/rspec-retry-0.6.1/lib/rspec/retry.rb:123:in `block in run'
# ./vendor/ruby/2.6.0/gems/rspec-retry-0.6.1/lib/rspec/retry.rb:110:in `loop'
# ./vendor/ruby/2.6.0/gems/rspec-retry-0.6.1/lib/rspec/retry.rb:110:in `run'
# ./vendor/ruby/2.6.0/gems/rspec-retry-0.6.1/lib/rspec_ext/rspec_ext.rb:12:in `run_with_retry'
# ./vendor/ruby/2.6.0/gems/rspec-retry-0.6.1/lib/rspec/retry.rb:37:in `block (2 levels) in setup'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:450:in `instance_exec'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:450:in `instance_exec'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/hooks.rb:381:in `execute_with'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/hooks.rb:614:in `block (2 levels) in run_around_example_hooks_for'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:345:in `call'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/hooks.rb:615:in `run_around_example_hooks_for'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/hooks.rb:472:in `run'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:460:in `with_around_example_hooks'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:503:in `with_around_and_singleton_context_hooks'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:254:in `run'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example_group.rb:633:in `block in run_examples'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example_group.rb:629:in `map'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example_group.rb:629:in `run_examples'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example_group.rb:595:in `run'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example_group.rb:596:in `block in run'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example_group.rb:596:in `map'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/example_group.rb:596:in `run'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/runner.rb:121:in `block (3 levels) in run_specs'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/runner.rb:121:in `map'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/runner.rb:121:in `block (2 levels) in run_specs'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/configuration.rb:2031:in `with_suite_hooks'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/runner.rb:116:in `block in run_specs'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/reporter.rb:74:in `report'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/runner.rb:115:in `run_specs'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/runner.rb:89:in `run'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/runner.rb:71:in `run'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/lib/rspec/core/runner.rb:45:in `invoke'
# ./vendor/ruby/2.6.0/gems/rspec-core-3.9.1/exe/rspec:4:in `<top (required)>'
# ./vendor/ruby/2.6.0/bin/rspec:23:in `load'
# ./vendor/ruby/2.6.0/bin/rspec:23:in `<top (required)>'
# /usr/local/lib/ruby/2.6.0/bundler/cli/exec.rb:74:in `load'
# /usr/local/lib/ruby/2.6.0/bundler/cli/exec.rb:74:in `kernel_load'
# /usr/local/lib/ruby/2.6.0/bundler/cli/exec.rb:28:in `run'
# /usr/local/lib/ruby/2.6.0/bundler/cli.rb:463:in `exec'
# /usr/local/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
# /usr/local/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
# /usr/local/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
# /usr/local/lib/ruby/2.6.0/bundler/cli.rb:27:in `dispatch'
# /usr/local/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
# /usr/local/lib/ruby/2.6.0/bundler/cli.rb:18:in `start'
# /usr/local/lib/ruby/gems/2.6.0/gems/bundler-1.17.2/exe/bundle:30:in `block in <top (required)>'
# /usr/local/lib/ruby/2.6.0/bundler/friendly_errors.rb:124:in `with_friendly_errors'
# /usr/local/lib/ruby/gems/2.6.0/gems/bundler-1.17.2/exe/bundle:22:in `<top (required)>'
# /usr/local/bin/bundle:23:in `load'
# /usr/local/bin/bundle:23:in `<main>'
# ------------------
# --- Caused by: ---
# PG::UndefinedTable:
# ERROR: relation "bulk_insert_items" does not exist
# LINE 1: SELECT "bulk_insert_items".* FROM "bulk_insert_items" ORDER ...
# ^
# ./vendor/ruby/2.6.0/gems/activerecord-6.0.3.1/lib/active_record/connection_adapters/postgresql_adapter.rb:675:in `exec_params'
Edited by Stan Hu