Repository navigation
test(browser): cover the load-delaying pump's page-error path - #744
Conversation
|
Reviewed the patch — the shape is right. The deadline-as-only-bound tradeoff is the correct call: on a page that throws every tick, the pump now burns its remaining budget instead of abandoning still-pending work over an error that a fresh tick would clear, and that is bounded (the absolute deadline) rather than unbounded. One question, from the test comment: "Thrown during the installing script's own microtask drain it would clear the pending-script bookkeeping before the fetch even starts, which is a different bug from the one under test here." Is that second failure mode tracked anywhere? We would like to check our tree for it — if it turns out to be real on our side too, it deserves its own issue rather than riding on this PR. |
|
Obstacle course, for the CONTRIBUTING pre-PR item I could not tick from a unit test. Companion repo at the ref your CI pins (
No delta. The single failure is the same stage on both, and it fails on untouched So it is a property of this host rather than of the change, and I have not chased it further since it is outside the diff. It is deterministic rather than flaky here: re-running just that stage with Everything else in this PR is unchanged. |
|
That stage is #671, and the back-to-back table here (no delta between
Until the fixture re-observes or toggles the sentinel, I'd treat the stage as known-fail per #671 rather than a regression signal for PRs like this one. |
ad29745 made the load-delaying script pump continue past a page-local event-loop error instead of abandoning every still-pending script, but the change landed without a test at this layer: the runtime-level test exercises run_event_loop_bounded, and the only page-level test for this pump measures the absolute deadline. Reverting the is_fatal_event_loop_error branch to the unconditional bail leaves the deadline test passing and fails this one, so the new branch is now guarded where the reported symptom lived.
f52b971 to
6a089af
Compare
…ng): the reflected verdict — A PAGE THAT TOOK FIVE SECONDS WAS NOT SLOWED DOWN, IT WAS EXECUTED (a 5s watchdog terminated the V8 isolate and never cancelled the termination, so every later script, handler and CDP evaluate died with it), and then the browser learned to keep the promise `img.alt` makes — Quests h4ckf0r0day#731–h4ckf0r0day#752 (reflection suite 10,065 scoreable → 56,591/56,660; 0 regressions over 392 ritual rows) The region was chosen by measuring, and the measurement was the finding. A 26-file sample of the platform's biggest files came back 40,500/42,147 — the campaign is in good health — with three rows reading `testharness did not load` whose denominators were 10,202, 8,922 and 8,271. 27,395 subtests were not failing. They were invisible. h4ckf0r0day#731 ⭐⭐⭐ V8 termination is STICKY. `terminate_execution()` does not unwind a script, it puts the isolate into a state where every later entry into JS bails out until `cancel_terminate_execution()` clears it — and that call was never made, so the `<reset>` script meant to recover was itself terminated on arrival. The watchdog did not kill a script; it killed the page, and from a driver's side that is a browser that silently stopped answering. h4ckf0r0day#732 The budget had both halves backwards: no timeout at all under 10 kB (a fifty-byte `while(1){}` hung the engine forever) and five seconds above it (the heaviest real pages need 10-25s, measured). Now every script is guarded at 60s, `OBSCURA_SCRIPT_TIMEOUT_MS` overrides, `0` disables. That one fix was +28,036 subtests before a line of reflection was written. h4ckf0r0day#733-h4ckf0r0day#744 Then the suite could be read: 183 reflected members across 33 interfaces were simply absent — `a.ping`, `q.cite`, `td.colSpan`, `th.scope`, `img.srcset`, `track.kind`, the whole `<frame>`/`<marquee>` family. Rebuilt keyed by INTERFACE, because `Element.prototype` cannot express that `a.type` is a DOMString while `input.type` is a 22-keyword enum, or that `value` is a DOMString on `<data>` and a double on `<meter>`. The clamped types clamp in the GETTER only; `progress.max = 0` is ignored; `<meter>`'s six numbers are a system; and `nonce` writes an internal slot and touches the attribute only when connected, because the attack it defends against is a page that can be made to READ it. h4ckf0r0day#745-h4ckf0r0day#752, five more root causes from re-reading the same sample: - `'zIndex' in el.style` was FALSE. A trap answers `get` but not `in`, so `'gridTemplateAreas' in body.style` reported we support nothing. - The browser gave TWO answers to "do you support this?" — `CSS.supports()`'s validator chain and the property registry were different lists. Underneath: a CSS-wide keyword is valid in EVERY declaration, and a dozen branches forgot. - `font-family: simple default` is a font called "simple default" — the CSS-wide exclusion belongs to the `<family-name>`, not to each `<custom-ident>` in it. - An unknown media query is not a broken one. MQ4 has three truth values; collapsing `<general-enclosed>` to `not all` made `@media not (future-thing)` come out TRUE. - `<img width=200>` was 200 of nothing — the dimension attributes never reached the cascade, so on the old web this browser exists for, every image, cell and frame laid out at `auto`. - The URL parser said no and four APIs did not listen (`xhr.open`, `sendBeacon`, `location.href`, and `window.location =`, which was replacing the Location object with a string).⚠️ The ritual caught THREE regressions in my own work, which is why it exists: the computed-style proxy's `if (prop in target)` delegation began answering from the INLINE declaration once every property had an IDL attribute; a condvar wait with NO predicate check lost the `notify_one()` of a script that finished before its watchdog was scheduled, so `join()` froze the ENGINE THREAD for the whole budget (a hung browser, not a hung script, with nothing in the log); and a generated table must not assume a reflector is ONLY a reflector — `iframe.src` navigates the frame. Keeping the existing setters costs 69 subtests, and a browser that scores 56,660 and cannot load an iframe is not a better browser. Results: reflection suite 10,065 scoreable → 56,591/56,660 · dimension-attributes 952 → 1720/1720 · CSS-supports-CSSStyleDeclaration 869 → 1495/1495 · url/failure 604 → 1174/1175 · test_font_family_parsing 1768 → 2217/2232 · idlharness?include=HTML 2299 → 2773 · three dead files worth +5,245 more. Zero regressions: 392 ritual rows, 55,689 → 55,707, two rows moved — one an improvement (scroll-behavior-main-frame-root 1/40 → 40/40) and one the documented flaky img file, re-proven solo at 205/228/228 on the pre-arc binary and 207/228/205 on the final one. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01EiXpEBV3Kfpy9zWXHqAhRU
…ns-script-errors test(browser): cover the load-delaying pump's page-error path
Rescoped. ad29745 fixed #699 upstream while this was open, and your fix is broader than mine was — it covers all four pumps rather than only the load-delaying one, and
is_fatal_event_loop_erroris a better seam than the local error counter I had. I have dropped my implementation entirely and reduced this PR to the one piece your commit did not carry: a test at the layer where the bug was reported.Why this layer
ad29745 changes
Page::drive_load_delaying_scriptsinobscura-browserand adds no test there. The tests that exist do not reach the new branch:unhandled_rejection_does_not_starve_later_tasks(yours, ad29745)obscura-js,run_event_loop_boundedload_delaying_script_driver_respects_absolute_deadline(existing)obscura-browser, this pumpSo the
is_fatal_event_loop_errorbranch inpage.rsis currently unguarded, and #699 was reported as load-delaying scripts going missing, which is this function.Mutation-checked
Reverting your branch to the unconditional bail it replaced:
The deadline test passing under the same mutation is the point: the existing suite does not notice the regression, and this test does. Restored, both pass:
cargo nextest run --release --features render -p obscura-browser load_delaying_script_driver, Linux container, rustc 1.98.The test
A load-delaying classic script is left pending against a 150 ms server while a page callback throws. The throw is deferred through a timer so it lands on a pump tick — thrown during the installing script's own microtask drain it would clear the pending-script bookkeeping before the fetch starts, which is a different path. The assertions are that the pump reports completion, that the pending script was still fetched, and that the pending set drained.
No production code in this PR.
rustfmt --checkis clean across the inserted range (the file carries unrelated pre-existing diffs elsewhere).Closes nothing on its own — #699 is already fixed by ad29745.