Skip to content
代码片段 群组 项目
提交 d73465e0 编辑于 作者: John McDonnell's avatar John McDonnell
浏览文件

[E2E] Harden pipeline with protected variable spec

The specs in pipeline_with_protected_variable_spec rely on adding
a user to a project, but as this operation occurs async I believe
in some situations this may not process in time for the test. By
adding some retry logic here to allow for this we should help to
reduce the number of flaky failures related to this.

Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/435608
Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/429876
上级 7ab58e0e
No related branches found
No related tags found
无相关合并请求
......@@ -91,23 +91,43 @@ def create_protected_branch
end
def user_commit_to_protected_branch(api_client)
create(:commit,
api_client: api_client,
project: project,
branch: 'protected-branch',
commit_message: Faker::Lorem.sentence, actions: [
{ action: 'create', file_path: Faker::File.unique.file_name, content: Faker::Lorem.sentence }
])
# Retry is needed due to delays with project authorization updates
# Long term solution to accessing the status of a project authorization update
# has been proposed in https://gitlab.com/gitlab-org/gitlab/-/issues/393369
Support::Retrier.retry_until(
max_duration: 60,
sleep_interval: 1,
message: "Commit to protected branch failed",
retry_on_exception: true
) do
create(:commit,
api_client: api_client,
project: project,
branch: 'protected-branch',
commit_message: Faker::Lorem.sentence, actions: [
{ action: 'create', file_path: Faker::File.unique.file_name, content: Faker::Lorem.sentence }
])
end
end
def create_merge_request(api_client)
create(:merge_request,
api_client: api_client,
project: project,
description: Faker::Lorem.sentence,
target_new_branch: false,
file_name: Faker::File.unique.file_name,
file_content: Faker::Lorem.sentence)
# Retry is needed due to delays with project authorization updates
# Long term solution to accessing the status of a project authorization update
# has been proposed in https://gitlab.com/gitlab-org/gitlab/-/issues/393369
Support::Retrier.retry_until(
max_duration: 60,
sleep_interval: 1,
message: "MR fabrication failed after retry",
retry_on_exception: true
) do
create(:merge_request,
api_client: api_client,
project: project,
description: Faker::Lorem.sentence,
target_new_branch: false,
file_name: Faker::File.unique.file_name,
file_content: Faker::Lorem.sentence)
end
end
def go_to_pipeline_job(user)
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册