summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Lapierre <mlapierre@gitlab.com>2019-06-04 09:33:05 +1000
committerMark Lapierre <mlapierre@gitlab.com>2019-06-06 13:11:54 +1000
commit4dc7a157aaf062de85e4c65add8446f7d5f8823c (patch)
tree8997d220597c9e031e3d26fc879d8059df2a1257
parent1bec362138bfcf6343a9cbc951ef5c8c07d2baaa (diff)
downloadgitlab-ce-4dc7a157aaf062de85e4c65add8446f7d5f8823c.tar.gz
Retry the first login page validation
It can take longer that 60 seconds for the server to be ready to respond. Retry the login page validation twice (i.e., 3 attempts to validate the login page)
-rw-r--r--qa/qa/ce/strategy.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/qa/qa/ce/strategy.rb b/qa/qa/ce/strategy.rb
index 7e2d02424fe..6c1820ffdc8 100644
--- a/qa/qa/ce/strategy.rb
+++ b/qa/qa/ce/strategy.rb
@@ -10,9 +10,18 @@ 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
+ end
+
+ raise
end
end
end