Skip to content

Set screenshot in after hook instead of around hook

Mark Lapierre requested to merge ml-avoid-nested-examples into master

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

Availability and Testing

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
Edited by Dan Davison

Merge request reports