summaryrefslogtreecommitdiff
path: root/spec/workers/cluster_update_app_worker_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/workers/cluster_update_app_worker_spec.rb')
-rw-r--r--spec/workers/cluster_update_app_worker_spec.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/spec/workers/cluster_update_app_worker_spec.rb b/spec/workers/cluster_update_app_worker_spec.rb
index d91104334e5..5391c194679 100644
--- a/spec/workers/cluster_update_app_worker_spec.rb
+++ b/spec/workers/cluster_update_app_worker_spec.rb
@@ -52,6 +52,8 @@ describe ClusterUpdateAppWorker do
let(:lease_key) { "#{described_class.name.underscore}-#{application.id}" }
before do
+ # update_highest_role uses exclusive key too:
+ allow(Gitlab::ExclusiveLease).to receive(:new).and_call_original
stub_exclusive_lease_taken(lease_key)
end
@@ -62,8 +64,6 @@ describe ClusterUpdateAppWorker do
end
it 'does not allow same app to be updated concurrently by different project', :aggregate_failures do
- stub_exclusive_lease("refresh_authorized_projects:#{user.id}")
- stub_exclusive_lease("update_highest_role:#{user.id}")
project1 = create(:project, namespace: create(:namespace, owner: user))
expect(Clusters::Applications::PrometheusUpdateService).not_to receive(:new)
@@ -87,8 +87,6 @@ describe ClusterUpdateAppWorker do
application2 = create(:clusters_applications_prometheus, :installed)
lease_key2 = "#{described_class.name.underscore}-#{application2.id}"
- stub_exclusive_lease("refresh_authorized_projects:#{user.id}")
- stub_exclusive_lease("update_highest_role:#{user.id}")
project2 = create(:project, namespace: create(:namespace, owner: user))
stub_exclusive_lease(lease_key2)