Repository navigation
test: retry E2E first navigation on ERR_NETWORK_CHANGED - #298
Open
Aaronontheweb wants to merge 1 commit into
Open
Aaronontheweb wants to merge 1 commit into
Aaronontheweb wants to merge 1 commit into
Conversation
CanDrawWithTouch intermittently fails its very first navigation with 'net::ERR_NETWORK_CHANGED at http://localhost:<port>/'. That is Chromium aborting an in-flight request because it observed a host network-state change - Docker creating/removing container bridge interfaces while Aspire starts resources produces exactly that. It is not an app error. Evidence (run 40782982599, Test-ubuntu-latest): - Failed case died in 114ms versus 1-3s for the three passing viewports, so it aborted before the page rendered anything. - Rerunning the failed jobs passed all four viewports. - Same signature documented in microsoft/playwright#13062 (container, retry clears it) and Grizzly-Endeavors/residuum#592 (Docker bridge churn explicitly named as the cause). Fix: add GotoWithNetworkChangeRetryAsync, which retries only when the exception message contains ERR_NETWORK_CHANGED, up to 3 attempts with backoff. Any other PlaywrightException propagates unchanged, so real failures are still real failures. The abort happens before the page has rendered, so retrying that specific navigation is side-effect free. Applied to the first navigation in both E2E interaction tests - the mouse test has the identical unguarded pattern and the same exposure. Scope is deliberately minimal: this does not address the separate 5s locator timeout for a[href='NewPaint'] seen on dev in August, nor the unguarded _localActorHandle.Tell in Paint.razor:268.
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.
Deflakes
CanDrawWithTouch, which intermittently fails its first navigation withnet::ERR_NETWORK_CHANGED.Root cause
Chromium aborts in-flight requests when it observes a host network-state change. Docker creating/removing container bridge interfaces while Aspire starts resources produces exactly that. This is a browser/transport behavior, not an app error.
Evidence
From run 40782982599, job
Test-ubuntu-latest:/paintpath, no management/bootstrap/discovery, no restart policy - that can abort an in-flight request.Fix
GotoWithNetworkChangeRetryAsyncretries only when the exception message containsERR_NETWORK_CHANGED, up to 3 attempts with 250 ms/500 ms backoff. Every otherPlaywrightExceptionpropagates unchanged, so real failures stay real. The abort happens before the page has rendered, so retrying that specific navigation is side-effect free.Applied to the first navigation in both interaction tests -
DrawingMouseInteractionTestshas the identical unguarded pattern and the same exposure.Deliberately out of scope
a[href='NewPaint']seen on dev in August (run33213636917) - a Blazor render race after form submit, not a network change. Two independent timing assumptions._localActorHandle.TellatPaint.razor:268- anIActorRef?field, assigned at line 162, no null-guard, while lines 240/246 do use?.. It logs an NRE on every prerendered/paint/{id}teardown, but it is causally independent of this flake (Kestrel swallows it after the response completes). Tracking separately.Verification
Build: 0 errors. Full verification is CI-only - Playwright browsers and a warm SQL Server image are not available on this host, and the flake is intermittent (~2 known failures over months), so a green run is necessary but not sufficient signal.