diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-02-05 17:32:52 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-02-05 17:32:52 +0300 |
commit | 5f57c7a5a54d844fb3f8566dd81da3cdde2f3c5b (patch) | |
tree | daff347a1fce0728cdb658464a48cc87e74662d2 /spec/services | |
parent | 48b0bc330add0fbb3398890e20a7444ba69d5f9a (diff) |
Revert create job service because of load balancing
Currently we still need to run EnsureStageService within a transaction,
because when it runs within in a transaction we are going to stick to
the primary database when using database load balancing. Extracting this
out of the transaction makes it possible to hit into problems with
replication lag in pipeline commit status API, which can cause a lot of
trouble.
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/ci/create_job_service_spec.rb | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/spec/services/ci/create_job_service_spec.rb b/spec/services/ci/create_job_service_spec.rb deleted file mode 100644 index d9dd1a40325..00000000000 --- a/spec/services/ci/create_job_service_spec.rb +++ /dev/null @@ -1,26 +0,0 @@ -require 'spec_helper' - -describe Ci::CreateJobService, '#execute' do - set(:project) { create(:project, :repository) } - let(:user) { create(:admin) } - let(:status) { build(:ci_build) } - let(:service) { described_class.new(project, user) } - - it 'persists job object instantiated in the block' do - expect(service.execute { status }).to be_persisted - end - - it 'persists a job instance passed as an argument' do - expect(service.execute(status)).to be_persisted - end - - it 'ensures that a job has a stage assigned' do - expect(service.execute(status).stage_id).to be_present - end - - it 'does not raise error if status is invalid' do - status.name = nil - - expect(service.execute(status)).not_to be_persisted - end -end |