Skip to content

CI: retry testem ci once on failure (Browserstack flake rescue)#21325

Open
johanrd wants to merge 1 commit intoemberjs:mainfrom
johanrd:ci/browserstack-reliability
Open

CI: retry testem ci once on failure (Browserstack flake rescue)#21325
johanrd wants to merge 1 commit intoemberjs:mainfrom
johanrd:ci/browserstack-reliability

Conversation

@johanrd
Copy link
Copy Markdown
Contributor

@johanrd johanrd commented Apr 20, 2026

Wraps testem ci in bin/run-browserstack-tests.js in a 2-attempt retry. If the second attempt also fails, the job fails normally. Avoiding ~15 false-positive CI failures per quarter is considered a bigger win than wasting ~9 unnecessary retries on failures the retry can't help.

Occurrences last three months:

Run Pattern Possible effect of PR
22652639356
(2026-03-04)
TypeError: Load failed (Safari) ✅️ autorecover?
24045457073
(2026-04-06)
TypeError: Load failed (Safari) ✅️ autorecover?
24562736533
(2026-04-17)
TypeError: Load failed (Safari) ✅️ autorecover?
24655116088
(2026-04-20)
TypeError: Load failed (Safari, PR #32 motivating) ✅️ autorecover?
23318447222
(2026-03-19)
Assertion occurred after test finished (Safari) ✅️ autorecover?
23374608293
(2026-03-21)
Assertion occurred after test finished (Safari, on Can use hash test) ⚠️ recurred 6× on Safari; retry unlikely to recover
23398101871
(2026-03-22)
Assertion occurred after test finished (Safari, on Can use hash test) ⚠️ recurred 6× on Safari; retry unlikely to recover
23426251444
(2026-03-23)
Assertion occurred after test finished (Safari, on Can use hash test) ⚠️ recurred 6× on Safari; retry unlikely to recover
23430422282
(2026-03-23)
Assertion occurred after test finished (Safari, on Can use hash test) ⚠️ recurred 6× on Safari; retry unlikely to recover
23455894140
(2026-03-23)
Assertion occurred after test finished (Safari, on Can use hash test) ⚠️ recurred 6× on Safari; retry unlikely to recover
23456175289
(2026-03-23)
Assertion occurred after test finished (Safari, on Can use hash test) ⚠️ recurred 6× on Safari; retry unlikely to recover
21239406320
(2026-01-22)
Browser timeout exceeded: 120s (Safari) ✅️ autorecover?
22476826260
(2026-02-27)
Browser timeout exceeded: 120s (Safari) ✅️ autorecover?
22634897665
(2026-03-03)
Browser timeout exceeded: 120s (Chrome, on instance tracking: tracks built instances) ✅️ autorecover?
22650604376
(2026-03-04)
Browser timeout exceeded: 120s (Chrome, on same Can use hash test) ⚠️ same recurring test; retry unlikely to recover
22735732561
(2026-03-05)
Browser timeout exceeded: 120s (Safari, on Registry: knownForType) ✅️ autorecover?
22736088751
(2026-03-05)
Browser timeout exceeded: 120s (Safari, on Can use Textarea) ✅️ autorecover?
22736440360
(2026-03-05)
Browser timeout exceeded: 120s (Safari, on Dynamic content tests) ✅️ autorecover?
21349229095
(2026-01-26)
Browser exited unexpectedly (Chrome only; Safari + Edge passed) ✅️ autorecover?
22201213313
(2026-02-19)
All launchers fail at startup (BrowserStack Cloudflare challenge) ⚠️ not recover and double ci time
22651153617
(2026-03-04)
Browser exited unexpectedly (Chrome only; Safari + Edge passed) ✅️ autorecover?
23040545692
(2026-03-13)
Browser exited unexpectedly (Chrome + Edge; Safari passed) ✅️ autorecover?
23662618302
(2026-03-27)
All launchers fail at startup (BrowserStack Cloudflare challenge) ⚠️ not recover and double ci time
23967918042
(2026-04-04)
Browser exited unexpectedly (Chrome only; Safari + Edge passed) ✅️ autorecover?

Caveats

  • Helps only for independent per-attempt failures. Correlated failures fail both attempts.
  • Worst-case CI time and BrowserStack session minutes roughly double on a retry.
  • Deterministic bugs still surface — they fail both attempts.

Scoped to the BrowserStack-only job; Firefox/Chrome coverage in the regular browser-test job is unchanged. Testem doesn't expose a native retry option.

Cowritten by claude

Copy link
Copy Markdown
Contributor

@NullVoxPopuli NullVoxPopuli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems worth it

@NullVoxPopuli
Copy link
Copy Markdown
Contributor

to be fair tho, we did actually introduce an instability that we had to fix.

my biggest worry with something like this is that we'll miss real problems

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.

2 participants