diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-24 18:10:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-24 18:10:36 +0300 |
commit | 234dc40a12a1cdaef0cdb825ca4acc3f271c6394 (patch) | |
tree | fb9875dca8b558acafa54c36a591b4d2ed10fc49 /spec/workers | |
parent | c7864d3d50b4002c621c7cba2e1ebfb5d23ac7ed (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers')
-rw-r--r-- | spec/workers/expire_job_cache_worker_spec.rb | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/spec/workers/expire_job_cache_worker_spec.rb b/spec/workers/expire_job_cache_worker_spec.rb index cbd9dd39336..e5a78f7b0ef 100644 --- a/spec/workers/expire_job_cache_worker_spec.rb +++ b/spec/workers/expire_job_cache_worker_spec.rb @@ -13,27 +13,6 @@ RSpec.describe ExpireJobCacheWorker do let(:job_args) { job.id } - include_examples 'an idempotent worker' do - it 'invalidates Etag caching for the job path' do - job_path = "/#{project.full_path}/builds/#{job.id}.json" - - spy_store = Gitlab::EtagCaching::Store.new - - allow(Gitlab::EtagCaching::Store).to receive(:new) { spy_store } - - expect(spy_store).to receive(:touch) - .exactly(worker_exec_times).times - .with(job_path) - .and_call_original - - expect(ExpirePipelineCacheWorker).to receive(:perform_async) - .with(pipeline.id) - .exactly(worker_exec_times).times - - subject - end - end - it 'does not perform extra queries', :aggregate_failures do worker = described_class.new recorder = ActiveRecord::QueryRecorder.new { worker.perform(job.id) } @@ -51,6 +30,11 @@ RSpec.describe ExpireJobCacheWorker do expect(namespace_queries.size).to eq(0) expect(route_queries.size).to eq(0) end + + it_behaves_like 'worker with data consistency', + described_class, + feature_flag: :load_balancing_for_expire_job_cache_worker, + data_consistency: :delayed end context 'when there is no job in the pipeline' do |