Skip to content

test: count Firefox's module-load warning only where the network failed too - #6509

Merged
max-sixty merged 3 commits into
mainfrom
test/cut-off-module-import
Nov 19, 2026
Merged

max-sixty merged 3 commits into
mainfrom
test/cut-off-module-import

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

test_the_comment_box_comes_back_to_where_its_passage_starts[firefox_browser] errors at teardown on CI's Mac with Firefox's "Loading failed for the module with source …". It did so once in the nightly of #6392 (checks/view.js) and in dispatches since (validation.js, checks/framing.js, runtime/check-api.js). No module failed to load for a reader; the browser fixture misread the browser's report, so this changes the fixture.

Cause. The test reloads its page to reopen a saved draft. Where the page it leaves is still importing modules, the reload cuts those imports off: the author view's probe (checks/view.js, imported lazily by user-view.js), or the check API's modules. As Firefox lets the old document go, it writes "Loading failed for the module" for each import there, both the cut modules and those waiting on them, even modules the page already held. The fixture counted each as a failure of the page. Chromium writes nothing for the same cut.

  • Reproduced locally: reloading a fresh page at 0 to 600 ms after it opens, 64 times, six at once, main's fixture errored 2 at teardown on cut-off imports. One cut warned for http-api.js with no failed request behind it, beside five modules whose requests failed with NS_BINDING_ABORTED.
  • Not a product defect: the imports belonged to the document the reload replaced, and the new document imports what it needs again.

Fix. Firefox's module-load warning now counts only where the network shows that module failing too: its request failed other than by the browser's own cut (NS_BINDING_ABORTED), or was answered with an error status. A cut-off shows neither. The fixture listens for this on Firefox pages only, since only Firefox writes the warning.

  • Regression test: test_a_module_import_a_navigation_cuts_off_is_no_problem holds an import unanswered, reloads, then makes an import fail. On main's fixture it fails, taking the cut-off import's warning for the failure.
  • Departure test: test_a_firefox_departure_reports_none_of_the_loads_it_aborts consumed the departure's warning. The fixture no longer reports it, so the test now checks that nothing is left.
  • Rejected: matching each warning to its own module's cut request missed the modules waiting on a cut, which have no request of their own. Dropping warnings while the page navigates, until its next document commits, raced Firefox's teardown: on CI, 4 of 48 copies got warnings after the commit.

Evidence (CI's Mac, Firefox, four copies at once). A cut-off warning on main errored the test at teardown in 2 of 72 copies:

Commit Copies Cut-off warnings Other failures Run
main 16 1 1: Page.goto past 240 s 44479170489
main, after the 43 tests the nightly's worker ran first 8 0 0 44479167350
main 48 1 2: Page.goto past 240 s, Page.reload past 120 s 44485902754
this change 64 0 0 44492926455
this change, with the two tests above (48 of 48 each) 48 0 2: Page.reload past 120 s; the composer left put away (below) 44492899124

At main's rate, the 112 copies of this change would have errored about 3 times. Every goto and reload timeout fell in a run's first round of copies, which the dispatch's background priority starves on CI's fresh Mac (on main and here alike).

Not settled here: the nightly's call failure, where the composer doesn't come back after the reload. It recurred once in this change's 112 copies (none of main's 72), in the starved first round. Its screenshot matches the nightly's: the panel's inbox shows the draft's dot, so the draft reached the page, but startup didn't reopen it. Startup reopens a saved draft once, only while the user has made no input since the document arrived (recoverComposer in leaf.js), so either the draft reached the page after that check or something counted as input during the slow start. This change doesn't touch it.

Refs #6392.

This was written by Claude Code on behalf of max-sixty

`test_the_comment_box_comes_back_to_where_its_passage_starts[firefox_browser]`
reloads its page to reopen a saved draft. Where the page it leaves is
still importing a module, as the author view's probe (`checks/view.js`)
or the check API's `validation.js` lazily does, the reload cuts that
import off, and Firefox writes "Loading failed for the module with source
…" to the console of the page it leaves. The browser fixture took that
warning for a failure of the page and errored the test at teardown;
Chromium says nothing. The new document imports the module again when it
needs it, so nothing failed for a reader.

The watch now drops that warning where the request's own failure names
the cut (`NS_BINDING_ABORTED`), whichever of the two reports arrives
first, and keeps it for an import the browser could not complete.
`test_a_module_import_a_navigation_cuts_off_is_no_problem` holds an
import unanswered, reloads, then has an import fail; on main's harness it
fails, taking the cut-off import's warning for the failure.

Refs #6392.

> _This was written by Claude Code on behalf of max-sixty_
…ocument

Matching each warning to its module's own cut request missed some: a
reload on CI's Mac cut off a lazily loaded graph, and Firefox warned for
modules with no failed request behind them, as `http-api.js` did locally
beside five that failed `NS_BINDING_ABORTED`. Firefox writes these as it
lets the document go, so the watch now drops them for as long as the
page's own frame is leaving its document: from its next navigation's
request or the first module it cuts off until the next document
commits. A module import that fails while a document stands is still
reported.

The regression test now holds a module the page has not loaded
(`validation.js?cut-off`), since the page may already hold
`validation.js`, and then no request goes out to hold.

Locally, 64 reloads of a fresh page at 0 to 600 ms, six at once: main's
harness errored 2 at teardown on cut-off imports, this one none.

> _This was written by Claude Code on behalf of max-sixty_
…ed too

Bounding the cut by the navigation's events still raced Firefox: on CI's
Mac, warnings reached the page after its next document had committed,
among them imports of modules the page already held (`check-api.js`,
`widget-api.js`), which fail only because Firefox tears the leaving
document's module loader down. The network doesn't race. A module whose
load really failed shows it there first: its request failed other than by
the browser's own cut (`NS_BINDING_ABORTED`), or was answered with an
error status. A cut-off shows neither. So the watch now counts Firefox's
warning only where the network shows its module failing, and listens for
that on Firefox pages alone, since only Firefox writes the warning.

`test_a_firefox_departure_reports_none_of_the_loads_it_aborts` consumed
the departure's warning. The watch no longer reports it, so the test now
checks that nothing is left.

> _This was written by Claude Code on behalf of max-sixty_
@max-sixty
max-sixty marked this pull request as ready for review November 19, 2026 09:58
@max-sixty
max-sixty merged commit b1093cc into main Nov 19, 2026
5 checks passed
@max-sixty
max-sixty deleted the test/cut-off-module-import branch November 19, 2026 09:58
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