diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-01-25 18:14:56 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-01-25 18:14:56 +0000 |
commit | 637894de8868b05499a275e1685621473addef58 (patch) | |
tree | 017f01e30effce8f80cfae61be5296e318f55cdb /spec/requests | |
parent | 6cfe60df2275dace9804f4bc37b9746a9eadc6fd (diff) | |
parent | 31be74c74b72a1cd33e1630f9462ab5c43f2e319 (diff) | |
download | gitlab-ce-637894de8868b05499a275e1685621473addef58.tar.gz |
Merge branch 'fix-ci-requests-concurrency' into 'master'
Fix CI requests concurrency
See merge request !8760
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/ci/api/builds_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/requests/ci/api/builds_spec.rb b/spec/requests/ci/api/builds_spec.rb index 270c23e3f19..8dbe5f0b025 100644 --- a/spec/requests/ci/api/builds_spec.rb +++ b/spec/requests/ci/api/builds_spec.rb @@ -91,6 +91,20 @@ describe Ci::API::Builds do expect { register_builds }.to change { runner.reload.contacted_at } end + context 'when concurrently updating build' do + before do + expect_any_instance_of(Ci::Build).to receive(:run!). + and_raise(ActiveRecord::StaleObjectError.new(nil, nil)) + end + + it 'returns a conflict' do + register_builds info: { platform: :darwin } + + expect(response).to have_http_status(409) + expect(response.headers).not_to have_key('X-GitLab-Last-Update') + end + end + context 'registry credentials' do let(:registry_credentials) do { 'type' => 'registry', |