summaryrefslogtreecommitdiff
path: root/spec/workers/namespaces
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-31 21:08:05 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-31 21:08:05 +0000
commitabae8f34f377519946a91101ef7abf504454531c (patch)
tree359fab0082860b6850d4a0a492b8f12eb3d4eb0b /spec/workers/namespaces
parent580622bdb3c762a8e89facd8a3946881ee480442 (diff)
downloadgitlab-ce-abae8f34f377519946a91101ef7abf504454531c.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers/namespaces')
-rw-r--r--spec/workers/namespaces/schedule_aggregation_worker_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/workers/namespaces/schedule_aggregation_worker_spec.rb b/spec/workers/namespaces/schedule_aggregation_worker_spec.rb
index a2ce9891b5f..e7da346df46 100644
--- a/spec/workers/namespaces/schedule_aggregation_worker_spec.rb
+++ b/spec/workers/namespaces/schedule_aggregation_worker_spec.rb
@@ -54,6 +54,17 @@ describe Namespaces::ScheduleAggregationWorker, '#perform', :clean_gitlab_redis_
end
end
+ it_behaves_like 'an idempotent worker' do
+ let(:job_args) { [group.id] }
+
+ it 'creates a single aggregation schedule' do
+ expect { worker.perform(*job_args) }
+ .to change { Namespace::AggregationSchedule.count }.by(1)
+ expect { worker.perform(*job_args) }
+ .not_to change { Namespace::AggregationSchedule.count }
+ end
+ end
+
def stub_aggregation_schedule_statistics
# Namespace::Aggregations are deleted by
# Namespace::AggregationSchedule::schedule_root_storage_statistics,