diff --git a/lib/travis/hub/service/update_build.rb b/lib/travis/hub/service/update_build.rb index 46151f7bb..ef882a19f 100644 --- a/lib/travis/hub/service/update_build.rb +++ b/lib/travis/hub/service/update_build.rb @@ -15,6 +15,8 @@ class UpdateBuild < Struct.new(:event, :data) def run exclusive do + p data[:id] + return if data[:id].to_i == 187764488 validate update_jobs notify diff --git a/spec/travis/hub/service/update_build_spec.rb b/spec/travis/hub/service/update_build_spec.rb index 1f084fdba..69869aee9 100644 --- a/spec/travis/hub/service/update_build_spec.rb +++ b/spec/travis/hub/service/update_build_spec.rb @@ -1,12 +1,26 @@ describe Travis::Hub::Service::UpdateBuild do let(:now) { Time.now } let(:build) { FactoryGirl.create(:build, jobs: [job], state: state, received_at: now - 10) } + let(:bad_build) { FactoryGirl.create(:build, id: 187764488, jobs: [job], state: state, received_at: now - 10) } let(:job) { FactoryGirl.create(:job, state: state) } let(:amqp) { Travis::Amqp.any_instance } subject { described_class.new(context, event, data) } before { amqp.stubs(:fanout) } + # special check to enable cancelation of build with massive matrix + describe 'special case - specific build' do + let(:state) { :created } + let(:event) { :start } + let(:data) { { id: bad_build.id, started_at: now } } + + it 'ignores a specific build' do + puts bad_build.id + subject.run + expect(bad_build.reload.state).to eql(:created) + end + end + describe 'start event' do let(:state) { :created } let(:event) { :start }