Order dependent spec: ./spec/workers/packages/cleanup_package_file_worker_spec.rb:22 # Packages::CleanupPackageFileWorker#perform_work with work to do deletes the oldest package file pending destruction based on id
Job #2331047677 failed for 19add555:
Failures:
1) Packages::CleanupPackageFileWorker#perform_work with work to do deletes the oldest package file pending destruction based on id
Failure/Error: expect { package_file2.reload }.to raise_error(ActiveRecord::RecordNotFound)
expected ActiveRecord::RecordNotFound but nothing was raised
# ./spec/workers/packages/cleanup_package_file_worker_spec.rb:27:in `block (4 levels) in <top (required)>'
# ./spec/spec_helper.rb:425:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:416:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:412:in `block (3 levels) in <top (required)>'
# ./lib/gitlab/application_context.rb:48:in `with_raw_context'
# ./spec/spec_helper.rb:412:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:270:in `block (2 levels) in <top (required)>'
# ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <top (required)>'
# ./spec/support/flaky_tests.rb:27:in `block (2 levels) in <top (required)>'
# ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <top (required)>'
# ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'
# ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <top (required)>'
2) Packages::CleanupPackageFileWorker#perform_work with work to do with a duplicated PyPI package file deletes one of the duplicates
Failure/Error: expect { package_file2.reload }.to raise_error(ActiveRecord::RecordNotFound)
expected ActiveRecord::RecordNotFound but nothing was raised
# ./spec/workers/packages/cleanup_package_file_worker_spec.rb:41:in `block (5 levels) in <top (required)>'
# ./spec/spec_helper.rb:425:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:416:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:412:in `block (3 levels) in <top (required)>'
# ./lib/gitlab/application_context.rb:48:in `with_raw_context'
# ./spec/spec_helper.rb:412:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:270:in `block (2 levels) in <top (required)>'
# ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <top (required)>'
# ./spec/support/flaky_tests.rb:27:in `block (2 levels) in <top (required)>'
# ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <top (required)>'
# ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'
# ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <top (required)>'
Finished in 12.18 seconds (files took 1 minute 7.29 seconds to load)
2 examples, 2 failures
Failed examples:
rspec ./spec/workers/packages/cleanup_package_file_worker_spec.rb:22 # Packages::CleanupPackageFileWorker#perform_work with work to do deletes the oldest package file pending destruction based on id
rspec ./spec/workers/packages/cleanup_package_file_worker_spec.rb:38 # Packages::CleanupPackageFileWorker#perform_work with work to do with a duplicated PyPI package file deletes one of the duplicates
Caveat
This is only happening on PG11
.
Reason
Deleting package files was relying on implicit ID ordering and this only reproducible on Postgres 11.6
(pg11
specs).
Edited by Peter Leitzen