Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2019-06-18 14:45:37 +0300
committerShinya Maeda <shinya@gitlab.com>2019-06-18 17:56:11 +0300
commit36b30cf18e7cf24fbb444eeecca70b719ed3208d (patch)
tree2b3d38079f8df8da57f61cca0489b442c72194ed /spec/services/ci/pipeline_schedule_service_spec.rb
parent6d68a3a254833ada6228bf245fc43bb8f4d6b85b (diff)
Revert concurrent pipeline schedule creation
This commit reverts the previously introduced concurrent pipeline schedule creation which was a viable solution for mitigating inconsistent pipeline schedule by Sidekiq Memory Killer.
Diffstat (limited to 'spec/services/ci/pipeline_schedule_service_spec.rb')
-rw-r--r--spec/services/ci/pipeline_schedule_service_spec.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/services/ci/pipeline_schedule_service_spec.rb b/spec/services/ci/pipeline_schedule_service_spec.rb
index 867ed0acc0d..f7590720f66 100644
--- a/spec/services/ci/pipeline_schedule_service_spec.rb
+++ b/spec/services/ci/pipeline_schedule_service_spec.rb
@@ -25,6 +25,38 @@ describe Ci::PipelineScheduleService do
subject
end
+ context 'when ci_pipeline_schedule_async feature flag is disabled' do
+ before do
+ stub_feature_flags(ci_pipeline_schedule_async: false)
+ end
+
+ it 'runs RunPipelineScheduleWorker synchronously' do
+ expect_next_instance_of(RunPipelineScheduleWorker) do |worker|
+ expect(worker).to receive(:perform).with(schedule.id, schedule.owner.id)
+ end
+
+ subject
+ end
+
+ it 'calls Garbage Collection manually' do
+ expect(GC).to receive(:start)
+
+ subject
+ end
+
+ context 'when ci_pipeline_schedule_force_gc feature flag is disabled' do
+ before do
+ stub_feature_flags(ci_pipeline_schedule_force_gc: false)
+ end
+
+ it 'does not call Garbage Collection manually' do
+ expect(GC).not_to receive(:start)
+
+ subject
+ end
+ end
+ end
+
context 'when owner is nil' do
let(:schedule) { create(:ci_pipeline_schedule, project: project, owner: nil) }