Commit 9704f753 authored by Adam Hegyi's avatar Adam Hegyi

Avoid 2PC when creating ci_builds

Avoid 2PC when creating ci_builds
parent 9c60a1fb
......@@ -48,6 +48,7 @@ FactoryBot.define do
transient { ci_ref_presence { true } }
before(:create) do |pipeline, evaluator|
pipeline.ensure_project_iid!
pipeline.ensure_ci_ref! if evaluator.ci_ref_presence && pipeline.ci_ref_id.nil?
end
......
......@@ -5289,4 +5289,10 @@ RSpec.describe Ci::Build do
expect(build.reload.queuing_entry).not_to be_present
end
end
it 'does not generate cross DB queries when a record is created via FactoryBot' do
with_cross_database_modification_prevented do
create(:ci_build)
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment