Commit 7da78439 authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch '339811-make-ci-build-and-pipeline-factories-2pc-free' into 'master'

Avoid 2PC when creating ci_builds

See merge request gitlab-org/gitlab!70687
parents 72441593 9704f753
......@@ -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