Commit d32cdb84 authored by Dan Davison's avatar Dan Davison

Merge branch 'qa-nightly-115-fix-retry-until' into 'master'

CE port of "Fix page refresh in retry_until"

See merge request gitlab-org/gitlab-ce!30656
parents 48cb7a5d f4a4f6e2
......@@ -26,7 +26,7 @@ module QA
end
def retry_until(max_attempts: 3, reload: false, sleep_interval: 0)
QA::Support::Retrier.retry_until(max_attempts: max_attempts, reload: reload, sleep_interval: sleep_interval) do
QA::Support::Retrier.retry_until(max_attempts: max_attempts, reload_page: (reload && self), sleep_interval: sleep_interval) do
yield
end
end
......
......@@ -11,7 +11,7 @@ module QA
expect(menu).to have_personal_area
end
Support::Retrier.retry_until(reload: false, sleep_interval: 0.5) do
Support::Retrier.retry_until(sleep_interval: 0.5) do
Page::Main::Menu.perform(&:sign_out)
Page::Main::Login.perform(&:has_sign_in_tab?)
......
......@@ -24,8 +24,8 @@ module QA
end
end
def retry_until(max_attempts: 3, reload: false, sleep_interval: 0)
QA::Runtime::Logger.debug("with retry_until: max_attempts #{max_attempts}; sleep_interval #{sleep_interval}; reload:#{reload}")
def retry_until(max_attempts: 3, reload_page: nil, sleep_interval: 0)
QA::Runtime::Logger.debug("with retry_until: max_attempts #{max_attempts}; sleep_interval #{sleep_interval}; reload_page:#{reload_page}")
attempts = 0
while attempts < max_attempts
......@@ -35,7 +35,7 @@ module QA
sleep sleep_interval
refresh if reload
reload_page.refresh if reload_page
attempts += 1
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