diff options
author | Dan Davison <ddavison@gitlab.com> | 2019-07-12 19:28:49 +0000 |
---|---|---|
committer | 🤖 GitLab Bot 🤖 <gitlab-bot@gitlab.com> | 2019-07-12 20:21:30 +0000 |
commit | 4f1b63428b094c7ea12c4ae1e96695979ee49756 (patch) | |
tree | f276991af390a2417a6970b7e028443cf8d1ea17 | |
parent | 9b717eea181e9e43a09b796da0c7c26c4e6dda7e (diff) | |
download | gitlab-ce-12-1-auto-deploy-0011943.tar.gz |
Merge branch 'qa-nightly-115-fix-retry-until' into 'master'12-1-auto-deploy-0011943
CE port of "Fix page refresh in retry_until"
See merge request gitlab-org/gitlab-ce!30656
(cherry picked from commit d32cdb840f8ebb9ada32f428bede4db637287516)
f4a4f6e2 Fix page refresh in retry_until
-rw-r--r-- | qa/qa/page/base.rb | 2 | ||||
-rw-r--r-- | qa/qa/specs/features/browser_ui/1_manage/login/log_in_spec.rb | 2 | ||||
-rw-r--r-- | qa/qa/support/retrier.rb | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/qa/qa/page/base.rb b/qa/qa/page/base.rb index 130e5e33ab4..80ce23d5c38 100644 --- a/qa/qa/page/base.rb +++ b/qa/qa/page/base.rb @@ -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 diff --git a/qa/qa/specs/features/browser_ui/1_manage/login/log_in_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/login/log_in_spec.rb index 5cd6bac3f5a..09d1d3fe76e 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/login/log_in_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/login/log_in_spec.rb @@ -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?) diff --git a/qa/qa/support/retrier.rb b/qa/qa/support/retrier.rb index 230cec8f8d2..720f1d17037 100644 --- a/qa/qa/support/retrier.rb +++ b/qa/qa/support/retrier.rb @@ -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 |