Skip to content

Commit a07fe7c

Browse files
wwwillchen-botwwwillchenclaude
authored
feat: make Playwright retries configurable via env var (#2558)
## Summary - Add PLAYWRIGHT_RETRIES env var support to allow different retry counts for different CI environments - Self-hosted macOS runners now use 1 retry (more reliable hardware) while GitHub-hosted runners use 2 retries - Refactors playwright.config.ts to read retries from environment variable with sensible defaults ## Test plan - Verify CI workflow sets PLAYWRIGHT_RETRIES appropriately for self-hosted vs GitHub-hosted runners - Run `npm test` to ensure all unit tests pass - E2E tests should respect the new retry configuration 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- devin-review-badge-begin --> --- <a href="https://app.devin.ai/review/dyad-sh/dyad/pull/2558" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1"> <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open with Devin"> </picture> </a> <!-- devin-review-badge-end --> <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Make Playwright retries configurable via the PLAYWRIGHT_RETRIES env var to tune test stability across environments. Self-hosted macOS runners use 1 retry; GitHub-hosted runners use 2 (local stays 0 unless set). - **New Features** - Added PLAYWRIGHT_RETRIES with sensible defaults (CI 2, local 0). - CI sets retries per runner type: 1 for self-hosted macOS, 2 for GitHub-hosted. <sup>Written for commit 896a3db. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> Co-authored-by: Will Chen <willchen90@gmail.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent fee4680 commit a07fe7c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@ jobs:
295295
FLAKINESS_ACCESS_TOKEN: ${{ secrets.FLAKINESS_ACCESS_TOKEN }}
296296
# Self-hosted macOS runners can handle more parallelism
297297
PLAYWRIGHT_PARALLELISM: ${{ contains(matrix.os.image, 'self-hosted') && '3' || '1' }}
298+
# Self-hosted macOS runners use fewer retries (1) vs GitHub-hosted CI (2)
299+
PLAYWRIGHT_RETRIES: ${{ contains(matrix.os.image, 'self-hosted') && '1' || '2' }}
298300
# You can add debug logging to make it easier to see what's failing
299301
# by adding "DEBUG=pw:browser" in front.
300302
# Use blob reporter for sharding and merge capabilities

playwright.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ const config: PlaywrightTestConfig = {
88
// Enable parallel test execution - E2E test builds skip the singleton lock
99
// Read parallelism from env var, default to 1 if not set
1010
workers: parseInt(process.env.PLAYWRIGHT_PARALLELISM || "1", 10),
11-
retries: process.env.CI ? 2 : 0,
11+
retries: parseInt(
12+
process.env.PLAYWRIGHT_RETRIES ?? (process.env.CI ? "2" : "0"),
13+
10,
14+
),
1215
timeout: process.env.CI ? 180_000 : 75_000,
1316
// Use a custom snapshot path template because Playwright's default
1417
// is platform-specific which isn't necessary for Dyad e2e tests

0 commit comments

Comments
 (0)