Skip to content

test: fix unload-IPC and protocol.handle 'is fast' flakes - #55083

Merged
MarshallOfSound merged 2 commits into
mainfrom
claude/fix-unload-ipc-and-protocol-is-fast-flakes
Oct 20, 2026
Merged

MarshallOfSound merged 2 commits into
mainfrom
claude/fix-unload-ipc-and-protocol-is-fast-flakes

Conversation

@claude

@claude claude Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Two spec flakes that the spec runner's end-of-job rerun has been hiding.

Unload-handler IPC tests (ipc module > WebFrameMain.ipc > receives ipcs from unloading frames in the main frame and webFrameMain module > RenderFrame lifespan > is detached when unload handler sends IPC, timing out on macOS arm64). After a cross-site navigation commits, Chromium gives the old frame 500 ms (kUnloadTimeout) to run its unload handler and then drops it along with any IPC it sends. Because the old renderer process no longer hosts an active page, it is also moved to background priority, which on macOS throttles its CPU and timers. With other spec workers busy, the unload handler misses the 500 ms window and the IPC never arrives. Both tests now append disable-renderer-backgrounding for their duration (removed in a defer unless it was already set). RenderProcessHostImpl checks the switch on every priority update, so it takes effect at runtime.

protocol module > handle > is fast (Windows x64: intercepted fetch is consistently 3.1-3.9x a direct fetch, limit 3x). The test now times three paths: a direct fetch, a handler that returns the net.fetch response untouched (relayed natively since #52953), and one that re-wraps it as new Response(res.body, res) so every chunk is pumped through JS. It warms all three paths, runs every ordering once, and compares the medians of the per-round ratios. It asserts relayed/direct < 5 on every platform to catch gross regressions, and relayed/piped < 0.8 on Linux only, which is the only platform measured so far (about 0.5x there). The failure message prints both ratios and the raw samples. On Linux it fails as expected when the relay is disabled.

Windows lead: the Windows intercepted timings are close to what the JS-pump path costs, not the native relay from #52953, so the relay may not be taking effect there. The new failure message will show this directly.

Validated on Linux against 46.0.0-nightly.20261016: each of the three tests passed 10/10. oxlint and tsc -p tsconfig.spec.json are clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LPMvJBQiyP6b7QjatACmnS

Notes: none


Generated by Claude Code

Keep renderers at foreground priority in the two tests that wait for an
IPC sent from an unload handler after a cross-site navigation, so the
backgrounded old renderer does not miss Chromium's 500 ms unload timeout
under parallel spec load.

Rework protocol.handle 'is fast' to compare the native relay path against
both a direct fetch and the JS-pumped path, with a looser bound against
direct fetches and timings in the failure message.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LPMvJBQiyP6b7QjatACmnS
@claude
claude Bot requested a review from jkleinsc October 17, 2026 14:37
@claude claude Bot added target/45-x-y PR should also be added to the "45-x-y" branch. target/44-x-y PR should also be added to the "44-x-y" branch. labels Oct 17, 2026
@claude
claude Bot marked this pull request as ready for review October 17, 2026 16:28
@MarshallOfSound
MarshallOfSound enabled auto-merge (squash) October 20, 2026 07:50
@MarshallOfSound
MarshallOfSound merged commit efd4495 into main Oct 20, 2026
74 checks passed
@MarshallOfSound
MarshallOfSound deleted the claude/fix-unload-ipc-and-protocol-is-fast-flakes branch October 20, 2026 07:50
@release-clerk

release-clerk Bot commented Oct 20, 2026

Copy link
Copy Markdown

No Release Notes

@trop

trop Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "45-x-y" cleanly;
you will need to perform this backport manually.

@trop trop Bot removed the target/45-x-y PR should also be added to the "45-x-y" branch. label Oct 20, 2026
@trop

trop Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "44-x-y" cleanly;
you will need to perform this backport manually.

@trop

trop Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

claude[bot] has manually backported this PR to "45-x-y", please check out #55132

@trop

trop Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

claude[bot] has manually backported this PR to "44-x-y", please check out #55133

jkleinsc pushed a commit that referenced this pull request Oct 20, 2026
test: fix unload-IPC and protocol.handle 'is fast' flakes (#55083)

* test: fix unload-IPC and protocol.handle 'is fast' flakes

Keep renderers at foreground priority in the two tests that wait for an
IPC sent from an unload handler after a cross-site navigation, so the
backgrounded old renderer does not miss Chromium's 500 ms unload timeout
under parallel spec load.

Rework protocol.handle 'is fast' to compare the native relay path against
both a direct fetch and the JS-pumped path, with a looser bound against
direct fetches and timings in the failure message.


Claude-Session: https://claude.ai/code/session_01LPMvJBQiyP6b7QjatACmnS

* test: fix lint


Claude-Session: https://claude.ai/code/session_01LPMvJBQiyP6b7QjatACmnS

---------


(cherry picked from commit efd4495)

Claude-Session: https://claude.ai/code/session_01LPMvJBQiyP6b7QjatACmnS

Co-authored-by: Claude <[email protected]>
@trop trop Bot added merged/45-x-y PR was merged to the "45-x-y" branch. and removed in-flight/45-x-y labels Oct 20, 2026
dsanders11 pushed a commit that referenced this pull request Oct 20, 2026
test: fix unload-IPC and protocol.handle 'is fast' flakes (#55083)

* test: fix unload-IPC and protocol.handle 'is fast' flakes

Keep renderers at foreground priority in the two tests that wait for an
IPC sent from an unload handler after a cross-site navigation, so the
backgrounded old renderer does not miss Chromium's 500 ms unload timeout
under parallel spec load.

Rework protocol.handle 'is fast' to compare the native relay path against
both a direct fetch and the JS-pumped path, with a looser bound against
direct fetches and timings in the failure message.


Claude-Session: https://claude.ai/code/session_01LPMvJBQiyP6b7QjatACmnS

* test: fix lint


Claude-Session: https://claude.ai/code/session_01LPMvJBQiyP6b7QjatACmnS

---------


(cherry picked from commit efd4495)

Claude-Session: https://claude.ai/code/session_01LPMvJBQiyP6b7QjatACmnS

Co-authored-by: Claude <[email protected]>
@trop trop Bot added merged/44-x-y PR was merged to the "44-x-y" branch. and removed in-flight/44-x-y labels Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

46-x-y merged/44-x-y PR was merged to the "44-x-y" branch. merged/45-x-y PR was merged to the "45-x-y" branch. semver/none

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants