fix(networkidle): do not wait for open EventSource (SSE) connections#41514
Open
mxschmitt wants to merge 1 commit into
Open
fix(networkidle): do not wait for open EventSource (SSE) connections#41514mxschmitt wants to merge 1 commit into
mxschmitt wants to merge 1 commit into
Conversation
Server-sent events (EventSource, text/event-stream) keep the HTTP
response open indefinitely, so the browser never reports the request as
finished. Because such a request stayed in the per-frame inflight set,
the network idle timer never started and `waitUntil: 'networkidle'` /
`waitForLoadState('networkidle')` would hang until the navigation
timeout on any page that opens an EventSource.
Exclude `eventsource` requests from the network idle inflight set, the
same way favicons are already excluded and WebSockets are tracked
separately. The resource type is known at request-start time across all
three backends, so the connection no longer gates networkidle.
Closes microsoft#37226
Contributor
Test results for "MCP"2 failed 7446 passed, 1132 skipped Merge workflow run. |
Contributor
Test results for "tests 1"2 failed 4 flaky44416 passed, 1071 skipped Merge workflow run. |
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.
Server-sent events (
EventSource,text/event-stream) keep the HTTP response open indefinitely, so the browser never reports the request as finished. Because such a request stayed in the per-frame inflight set, the network idle timer never started andwaitUntil: 'networkidle'/waitForLoadState('networkidle')would hang until the navigation timeout on any page that opens anEventSource.This excludes
eventsourcerequests from the network idle inflight set, the same way favicons are already excluded and WebSockets are tracked separately. The resource type is known at request-start time across all three backends, so the connection no longer gatesnetworkidle.Added regression tests in
page-network-idle.spec.ts(gotoandsetContent) that hang without the fix and pass with it on Chromium, Firefox and WebKit.Fixes #41513