Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
1dbc25e8
Commit
1dbc25e8
authored
Jun 11, 2019
by
Mark Lapierre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DRY exception handling
Use `retry_on_exception` instead of duplicating code
parent
20bb0d66
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
9 deletions
+2
-9
qa/qa/ce/strategy.rb
qa/qa/ce/strategy.rb
+2
-9
No files found.
qa/qa/ce/strategy.rb
View file @
1dbc25e8
...
@@ -10,18 +10,11 @@ module QA
...
@@ -10,18 +10,11 @@ module QA
end
end
def
perform_before_hooks
def
perform_before_hooks
retries
||=
0
# The login page could take some time to load the first time it is visited.
# 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.
# 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
)
QA
::
Support
::
Retrier
.
retry_on_exception
do
rescue
QA
::
Page
::
Validatable
::
PageValidationError
QA
::
Runtime
::
Browser
.
visit
(
:gitlab
,
QA
::
Page
::
Main
::
Login
)
if
(
retries
+=
1
)
<
3
Runtime
::
Logger
.
warn
(
"The login page did not appear as expected. Retrying... (attempt #
#{
retries
}
)"
)
retry
end
end
raise
end
end
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment