Repository navigation
test: count Firefox's module-load warning only where the network failed too - #6509
Merged
Merged
Conversation
`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_
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.
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 byuser-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.http-api.jswith no failed request behind it, beside five modules whose requests failed withNS_BINDING_ABORTED.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.test_a_module_import_a_navigation_cuts_off_is_no_problemholds 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.test_a_firefox_departure_reports_none_of_the_loads_it_abortsconsumed the departure's warning. The fixture no longer reports it, so the test now checks that nothing is left.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:
Page.gotopast 240 sPage.gotopast 240 s,Page.reloadpast 120 sPage.reloadpast 120 s; the composer left put away (below)At main's rate, the 112 copies of this change would have errored about 3 times. Every
gotoandreloadtimeout 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 (
recoverComposerinleaf.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.