diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /qa/qa/specs/features/api/3_create/merge_request | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) | |
download | gitlab-ce-7e9c479f7de77702622631cff2628a9c8dcbc627.tar.gz |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'qa/qa/specs/features/api/3_create/merge_request')
-rw-r--r-- | qa/qa/specs/features/api/3_create/merge_request/push_options_target_branch_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/qa/qa/specs/features/api/3_create/merge_request/push_options_target_branch_spec.rb b/qa/qa/specs/features/api/3_create/merge_request/push_options_target_branch_spec.rb index 6072fd8c1a2..e02d32bc4c7 100644 --- a/qa/qa/specs/features/api/3_create/merge_request/push_options_target_branch_spec.rb +++ b/qa/qa/specs/features/api/3_create/merge_request/push_options_target_branch_spec.rb @@ -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)}" |