Commit fdfc5d62 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'flaky-cleanup-package-spec' into 'master'

Fix flaky package cleanup spec

See merge request gitlab-org/gitlab!78578
parents 9d9b78d4 836d3bc6
...@@ -20,10 +20,7 @@ RSpec.describe Packages::CleanupPackageFileWorker do ...@@ -20,10 +20,7 @@ RSpec.describe Packages::CleanupPackageFileWorker do
let_it_be(:package_file3) { create(:package_file, :pending_destruction, package: package, updated_at: 1.year.ago, created_at: 1.year.ago) } let_it_be(:package_file3) { create(:package_file, :pending_destruction, package: package, updated_at: 1.year.ago, created_at: 1.year.ago) }
it 'deletes the oldest package file pending destruction based on id', :aggregate_failures do it 'deletes the oldest package file pending destruction based on id', :aggregate_failures do
# NOTE: The worker doesn't explicitly look for the lower id value, but this is how PostgreSQL works when expect(worker).to receive(:log_extra_metadata_on_done).twice
# using LIMIT without ORDER BY.
expect(worker).to receive(:log_extra_metadata_on_done).with(:package_file_id, package_file2.id)
expect(worker).to receive(:log_extra_metadata_on_done).with(:package_id, package.id)
expect { subject }.to change { Packages::PackageFile.count }.by(-1) expect { subject }.to change { Packages::PackageFile.count }.by(-1)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment