Skip to content

[Experiment] Retry failed specs in a new process after the initial run

Abstract

Given that a lot of flaky tests are unreliable due to previous test which are affecting the global state, retrying only the failing specs in a new RSpec process should result in a better overall success rate.

Pros

  • Automatically make the pipelines more successful

Cons

  • The retrying is transparent so we'll need a way to surface the automatically retried tests so that they're solved at some point
  • The retrying will add a few more minutes to the RSpec job

Timeframe

  • 14 days - from 2022-02-16 to 2022-03-02

Expected results

MR

Communication

  • 2022-01-26 Communicate in #development
    :mega: We’re going to start a 20-days experiment to retry failing tests in a separate RSpec process in order to detect order-dependent/global state problems and to increase `master`’s stability: https://gitlab.com/gitlab-org/quality/team-tasks/-/issues/1148. If you notice anything weird related to RSpec jobs, please let us know in #g_engineering_productivity. :mega: 
  • Add an item in the upcoming Eng. Week in Review
  • 2022-02-16 Communicate in #development
    :mega: We’re going to resume a 14-days experiment to retry failing tests in a separate RSpec process in order to detect order-dependent/global state problems and to increase `master`’s stability: https://gitlab.com/gitlab-org/quality/team-tasks/-/issues/1148. If you notice anything weird related to RSpec jobs, please let us know in #g_engineering_productivity. :mega: 

Once the experiment is validated:

  • Add an item in the upcoming Eng. Week in Review
  • Communicate in #development, #quality and more

How to enable

See https://docs.gitlab.com/ee/development/pipelines.html#automatic-retry-of-failing-tests-in-a-separate-process.

Set the $RETRY_FAILED_TESTS_IN_NEW_PROCESS variable to true.

How to disable

See https://docs.gitlab.com/ee/development/pipelines.html#automatic-retry-of-failing-tests-in-a-separate-process.

  • Globally: remove the $RETRY_FAILED_TESTS_IN_NEW_PROCESS variable (or set it to something different than true)
Edited by Rémy Coutable