From 4e0b5227283096e9b5f4e68b80b7080358b84bf8 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Tue, 19 Sep 2023 10:41:57 -0400 Subject: [PATCH] test(playwright): only use retries on CI (#28196) Issue number: N/A --------- ## What is the current behavior? We currently use retries on CI to help catch flaky tests. However, retries are enabled even when testing locally. This is not ideal because a failing test will be re-run multiple times before erroring out which increases the time it takes to run tests locally. I typically write tests before fixes so I can verify my test is checking the correct behavior. In this case I don't need it to be re-run twice -- I already know it's supposed to fail. ## What is the new behavior? - Test retries are only enabled on CI ## Does this introduce a breaking change? - [ ] Yes - [x] No ## Other information --- core/playwright.config.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/playwright.config.ts b/core/playwright.config.ts index 9cfb9fb810..4a7038b464 100644 --- a/core/playwright.config.ts +++ b/core/playwright.config.ts @@ -60,7 +60,8 @@ const config: PlaywrightTestConfig = { /* Fail the build on CI if you accidentally left test.only in the source code. */ forbidOnly: !!process.env.CI, maxFailures: 0, - retries: 2, + /* Test retries help catch flaky tests on CI */ + retries: process.env.CI ? 2 : 0, reportSlowTests: null, /* Opt out of parallel tests on CI. */ workers: process.env.CI ? 1 : undefined,