Browser runner: stall-based timeout, phase-aware page errors, afterEach on failure (0.2.19) - #26
Open
brainkim wants to merge 1 commit into
Open
Browser runner: stall-based timeout, phase-aware page errors, afterEach on failure (0.2.19)#26brainkim wants to merge 1 commit into
brainkim wants to merge 1 commit into
Conversation
…on failure Three browser-runner fixes from crank PR #375's firefox/webkit runs (coordinated with the crank session; verified against its real 602-test suite): - The browser timeout was one absolute deadline for the whole suite, while node/bun get `--timeout` per file - large suites "timed out" at the default while making steady progress (firefox launch alone is ~8s; the 1.6MB bundle parses in <600ms, measured, so it was never parse cost). The wait loop now resets on progress (ready flag, runner start, each completed test); `timeout` ms of NO progress is a hang. - Page errors are captured in-page with the phase known synchronously: pre-start errors mean registration was cut short (red); mid-run unhandled rejections are warnings (crank intentionally floats them to test error propagation, and its registration counts proved nothing was lost). Also unifies behavior across browsers - firefox routes unhandled rejections to Playwright's pageerror, chromium/webkit don't. - A load-phase throw fails in seconds naming the error instead of waiting out the full timeout in silence. - afterEach runs for failing tests too (#25), each hook individually guarded, test's own error kept - one real failure previously left a stub installed and cascaded into 23 reported failures on webkit. crank on firefox, default timeout: 602 passed, 0 failed, 3 skipped, with the 3 intentional rejections as warnings. Fixes #25 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Fixes #25 and both firefox problems reported by the crank session against 0.2.18 (crank PR bikeshaving/crank#375). Verified against crank's real suite — 30 files, 602 tests — cloned into a scratchpad.
Stall-based browser timeout
--timeoutis per-file on node/bun, but the browser ran the entire suite under one absolute deadline — 30 files (plus ~8s of firefox launch, measured) in a single file's allowance. Large suites "timed out" at the default while making steady progress. The wait loop now resets on progress (entry ready flag, runner start, each completed test);timeoutms of no progress is a genuine hang. Diagnostic dead end worth recording: the 1.6MB bundle parses in <600ms and inline-vs-external<script>makes no difference — startup cost is launch, not parse.Phase-aware page errors
0.2.17 failed the run on any
pageerror— but browsers disagree on what reaches it (firefox surfaces unhandled rejections there; chromium/webkit don't), so crank's intentional error-propagation rejections failed firefox only, with a message its registration counts disproved (all 602 tests ran). Uncaught errors are now captured in the page, where phase is known synchronously:A load-phase throw also now fails in ~5s naming the error, instead of waiting out the full timeout in silence.
afterEach runs for failing tests (#25)
Cleanup hooks moved out of the
try: they run in all cases, each individually guarded, the test's own error kept as the reported failure — matching node:test/bun:test. Previously one real failure left aconsole.errorstub installed and crank's webkit run reported 23 failures for 1 bug.Verification
602 passed, 0 failed, 3 skipped+ 3 warnings (was: timeout at 60s, or 3 spurious failures at 120s)3 passed, 1 failed— no cascade🤖 Generated with Claude Code
https://claude.ai/code/session_01QAc3iDuBb3zN41HrepErUw