Merge branch 'qa-ml-dry-retry-on-exception' into 'master'
[CE] use `retry_on_exception` instead of duplicating code See merge request gitlab-org/gitlab-ce!29452
This commit is contained in:
commit
c9216d6305
1 changed files with 2 additions and 9 deletions
|
@ -10,18 +10,11 @@ module QA
|
|||
end
|
||||
|
||||
def perform_before_hooks
|
||||
retries ||= 0
|
||||
|
||||
# The login page could take some time to load the first time it is visited.
|
||||
# We visit the login page and wait for it to properly load only once before the tests.
|
||||
QA::Runtime::Browser.visit(:gitlab, QA::Page::Main::Login)
|
||||
rescue QA::Page::Validatable::PageValidationError
|
||||
if (retries += 1) < 3
|
||||
Runtime::Logger.warn("The login page did not appear as expected. Retrying... (attempt ##{retries})")
|
||||
retry
|
||||
QA::Support::Retrier.retry_on_exception do
|
||||
QA::Runtime::Browser.visit(:gitlab, QA::Page::Main::Login)
|
||||
end
|
||||
|
||||
raise
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue