Commit 4d97ea41 authored by Mark Lapierre's avatar Mark Lapierre

Merge branch '254951-fix-attempt-confirm-branch-can-be-checked-out' into 'master'

Confirm test target branch can be checked out

See merge request gitlab-org/gitlab!45616
parents 59b1705a 551443f8
......@@ -25,6 +25,18 @@ module QA
push.file_content = "Target branch test target branch #{SecureRandom.hex(8)}"
end
# Confirm the target branch can be checked out to avoid a race condition
# where the subsequent push option attempts to create an MR before the target branch is ready.
Support::Retrier.retry_on_exception(sleep_interval: 5) do
Git::Repository.perform do |repository|
repository.uri = project.repository_http_location.uri
repository.use_default_credentials
repository.clone
repository.configure_identity('GitLab QA', 'root@gitlab.com')
repository.checkout(target_branch)
end
end
Resource::Repository::ProjectPush.fabricate! do |push|
push.project = project
push.branch_name = "push-options-test-#{SecureRandom.hex(8)}"
......
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