Skip to content

feat(ci): add fix-flakes workflow to auto-fix flaky tests#41692

Open
Skn0tt wants to merge 1 commit into
mainfrom
skn0tt-flaky-test-skill
Open

feat(ci): add fix-flakes workflow to auto-fix flaky tests#41692
Skn0tt wants to merge 1 commit into
mainfrom
skn0tt-flaky-test-skill

Conversation

@Skn0tt

@Skn0tt Skn0tt commented Jul 8, 2026

Copy link
Copy Markdown
Member

Adds a scheduled workflow that fixes one flaky or red test per weekday run, end to end. It works in three jobs:

  • triage queries the test-results DB and picks the single OS worth booting a runner for - or bails if nothing's actionable. It's cheap, so we don't spin up an expensive macOS machine on a hunch.
  • fix runs on that OS, reproduces one high-impact flaky/red test, and either fixes the root cause or scopes a fixme. It hands the result off as exactly one commit whose message becomes the PR.
  • open_pr turns that commit into a PR against main.

The fix agent holds no write token - a separate deterministic open_pr job is the only thing that can push or open a PR, and it does that through the playwright automation app. So a prompt-injected agent can't do anything worse than write a commit that a human then reviews.

#41691 is a real PR it produced end to end.

One temporary thing: review requests currently go to skn0tt while I build trust in it. The agent still works out the real reviewer and names them via a Suggested-reviewer trailer; once I trust it, I'll drop the override and let it request them directly.

A scheduled workflow that fights CI flakiness end to end, in three jobs:

- triage: an agent queries the test-results DB and picks the single
  OS/config most worth booting a runner for, or bails if nothing is
  actionable.
- fix: on the chosen runner, an agent reproduces one flaky/red test and
  either fixes the root cause or scopes a fixme, handing the result off
  as one commit whose message becomes the PR.
- open_pr: a trusted job reapplies that commit and opens a PR against
  main via the playwright automation app, requesting a review.

Adds the playwright-fix-flakes skill that drives the fix agent, and
teaches the playwright-test-results skill to query the DuckDB database
through the @duckdb/node-api binding.
@Skn0tt

Skn0tt commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

Discussed. An alternative approach came up: First agent turning flaky db into issues, second agent spinning up upon issue creation to fix them. Decoupled from one another.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Test results for "MCP"

2 failed
❌ [chrome] › mcp/cli-navigation.spec.ts:56 › goto chrome:// page that closes the tab does not crash the response @mcp-windows-latest-chrome
❌ [chromium] › mcp/dashboard.spec.ts:125 › daemon show: closing page exits the process @mcp-windows-latest-chromium

7713 passed, 1242 skipped


Merge workflow run.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

7 flaky ⚠️ [chromium-library] › library/chromium/chromium.spec.ts:211 › should intercept service worker requests (main and within) `@frozen-time-library-chromium-linux`
⚠️ [chromium-library] › library/video.spec.ts:476 › screencast › should capture static page in persistent context @smoke `@chromium-ubuntu-22.04-node24`
⚠️ [chromium-library] › library/popup.spec.ts:260 › should not throw when click closes popup `@chromium-ubuntu-22.04-node20`
⚠️ [chromium-library] › library/video.spec.ts:717 › screencast › should work with video+trace `@chromium-ubuntu-22.04-node20`
⚠️ [firefox-library] › library/har-websocket.spec.ts:231 › should embed websocket messages `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-library] › library/inspector/cli-codegen-3.spec.ts:224 › cli codegen › should generate frame locators (4) `@firefox-ubuntu-22.04-node20`
⚠️ [playwright-test] › ui-mode-test-output.spec.ts:160 › should format console messages in page `@windows-latest-node22`

49500 passed, 1162 skipped


Merge workflow run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant