Set screenshot in after hook instead of around hook
What does this MR do?
This is an attempt to avoid the many repeated call like this that happen when more than one test fails:
./qa/runtime/browser.rb:55:in `block (2 levels) in configure!'
./qa/runtime/browser.rb:55:in `block (2 levels) in configure!'
./qa/runtime/browser.rb:55:in `block (2 levels) in configure!'
./qa/runtime/browser.rb:55:in `block (2 levels) in configure!'
See the stack trace in this issue for how bad it gets: gitlab-org/quality/testcases#391 (comment 309079396)
The problem seems to be that the around
hook is executing the same line one extra time for each retry of a test in the test suite. So by the end of the suite with many failures that's a lot of retries.
If we use an after
hook we avoid the problematic call to example.run
on line 55.
Unfortunately I wasn't able to reproduce the problem locally, and not enough tests are currently failing, so I can't confirm that it's fixed. However, the change works, so we'll see if it helps when it runs in other pipelines.
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team