Repository navigation
ci(browser): run a failed browser script once more and report it as flaky - #1002
Merged
Merged
Conversation
…laky A script that fails and then passes no longer fails the lane, and is not a plain pass: its first log is kept and printed, summary.json lists it, and GitHub gets a warning annotation and a job summary line. Two failures still fail the lane; BROWSER_RETRY=0 turns the second run off.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 2 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
devswha
added a commit
that referenced
this pull request
Oct 14, 2026
…1009) ## Change Since #1002 a browser script that fails is run once more and a pass on the second run is reported as flaky. Two things were still missing for whoever maintains the lanes. **The report did not say what failed.** "FLAKY scripts/ui-regression.ts" names a script with 65 checks. The lane now reads the failed run's log for the first error line and the first stack frame in `scripts/`, and puts both in the console line, the warning annotation, the job summary and `summary.json`: ``` ::warning title=Flaky browser script::scripts/ui-regression.ts: scripts/terminal-input-regression.ts:65: AssertionError: input regression timed out failed once and passed when run again. … ``` A script that fails twice gets an `::error title=Browser script failed::` annotation with the same, which it did not have. A log with no recognisable error is reported as before, by script alone. **Nothing counted failures across runs.** `bun scripts/ci-flakes.ts [--hours 24] [--repo owner/name] [--json]` reads recent `ci.yml` runs through `gh`, every attempt of each, and prints each script and failing site with how often it failed and how often it passed only on a second run, most frequent first. It changes nothing. A failed job's log is read; a passed job's only when it carries the flaky warning, so 30 hours of this repository (242 runs, 516 browser jobs) take about 100 seconds instead of more than five minutes. What it shows today, first rows of `--hours 30`: | failed | flaky | script | site | |---|---|---|---| | 14 | 1 | ui-regression | terminal-input-regression.ts:65 (fixed in #1001) | | 11 | 0 | ui-contexts-regression | split-view-regression.ts:81 | | 10 | 0 | chat-virtual-browser-qa | chat-virtual-browser-qa.ts:169 | | 9 | 0 | pane-paging-demo-regression | pane-paging-demo-regression.ts:279 | | 8 | 0 | prompt-dock-demo-regression | (no script frame in the log) | No change to which scripts run, to the second run, to exit codes or to what gates a merge. ## Validation - macOS arm64, Bun 1.4.0. `bun run typecheck`: pass. `scripts/ci-flakes.test.ts` (new), `pages-gate.test.ts` (new cases for `failureSite`), `conventions.test.ts`, `changelog-fold.test.ts`: 0 fail. With `failureSite` made to return no site, 8 of those cases fail. - The lane, run for real with `BROWSER_SCRIPTS=scripts/deep-link-demo-regression.ts GITHUB_ACTIONS=true bun scripts/ci-browser-parallel.ts` and a throwaway line that made that script fail: - an assertion on the first run only: exit 0, the FLAKY line, the `::warning`, the job summary and `summary.json` all carry `scripts/deep-link-demo-regression.ts:10` and `AssertionError: scratch forced failure`; - the assertion on both runs: exit 1, `::error title=Browser script failed::` with the same; - `process.exit(1)` with nothing printed, first run only: exit 0, reported flaky by script alone, no "null" or "undefined". - `bun scripts/ci-flakes.ts --hours 30` against this repository: exit 0 in 103 s; lists `scripts/ui-regression.ts` as flaky for run 38490957637 and the pre-retry failures. `--json` parses. With `GH_TOKEN` set to a bad token it prints `gh: Bad credentials (HTTP 401)` and exits 1. - Not run locally: the integration lane and the browser lanes as a whole.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
CI's browser lanes failed about three in ten runs over the last day (57 of 192 jobs on the self-hosted runner, 29 of 89 on GitHub's before that), on
mainas on pull requests, at more than twenty different places. Until those races are fixed one by one (#984, #985 and the four in the companion PR are a start), every PR waits on reruns by hand.scripts/ci-browser-parallel.tsnow runs a failed script a second time. A script that then passes does not fail the lane, and is not hidden as a pass either:<script>.attempt-1.log(uploaded withbrowser-logs) and its last 400 lines are printed;~, andsummary.jsonlists it underflakywith the first log's path;A script that fails twice fails the lane as before.
BROWSER_RETRY=0turns the second run off. The serial lane (ci-browser.sh,bun run check browser) is unchanged: it still stops at the first failure.The cost is real and worth saying: a failure that only happens sometimes can now merge. That is why a flaky pass is loud. This keeps one PR from waiting on another change's race; it does not make a race acceptable.
Validation
bun run typecheck: pass.scripts/pages-gate.test.ts(new case forscriptOutcome),conventions.test.ts,changelog-fold.test.ts: 40 pass.BROWSER_SCRIPTS=scripts/deep-link-demo-regression.ts bun scripts/ci-browser-parallel.tsand a throwaway line that made that script exit 1:FLAKYline,~in the summary,flaky: ["scripts/deep-link-demo-regression.ts"]insummary.json, both logs present, the::warningline and the job-summary text written;BROWSER_RETRY=0: exit 1 after one run.