Skip to content
Snippets Groups Projects
Unverified Commit e256a46b authored by Mike Kozono's avatar Mike Kozono Committed by John Skarbek
Browse files

Bump allowed number of queries

During DestroyAllExpiredService.

The new query which is causing the number of queries to cross the limit
is:

`UPDATE "ci_job_artifacts" SET "expire_at" = NULL WHERE 1=0`

The where clause looks funny because there are zero wrongly expired
artifacts, yet `update_all` is called anyway, on a relation built with
an empty array. The new query is called at
app/services/ci/job_artifacts/destroy_batch_service.rb:142.

We are modifying only the test in this commit, since it is low risk.
parent 1cc2ad11
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -40,7 +40,7 @@ RSpec.describe Ci::JobArtifacts::DestroyAllExpiredService, :clean_gitlab_redis_s
# COMMIT
# SELECT next expired ci_job_artifacts
 
expect(log.count).to be_within(1).of(10)
expect(log.count).to be_within(1).of(11)
end
end
 
Loading
Loading
@@ -51,7 +51,7 @@ RSpec.describe Ci::JobArtifacts::DestroyAllExpiredService, :clean_gitlab_redis_s
 
it 'performs the smallest number of queries for job_artifacts' do
log = ActiveRecord::QueryRecorder.new { subject }
expect(log.count).to be_within(1).of(8)
expect(log.count).to be_within(1).of(9)
end
end
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment