Repository navigation
[release/17.0] Accept relay connection reset when waiting for stalled Blazor WASM bridge close - #22030
Closed
Mitch Denny (mitchdenny) wants to merge 1 commit into
Conversation
…idge close (#21963) The VS Code extension unit test `Blazor WASM debug relay closes a stalled bridge upgrade at the … launch deadline` failed on Windows with `Error: read ECONNRESET at TCP.onStreamRead` ([41953320272](https://github.com/microsoft/aspire/actions/runs/41953320272), [41969207688](https://github.com/microsoft/aspire/actions/runs/41969207688), [41509624265](https://github.com/microsoft/aspire/actions/runs/41509624265)). The relay behaves correctly: when the launch deadline expires it aborts the stalled `ws` opening, which destroys its upstream socket. On Windows, the test bridge's end of that socket can see the abort as a TCP reset, so it emits `error` (ECONNRESET) before `close`. The test waited with `events.once(socket, 'close')`, and `events.once` rejects when the emitter emits `error`, so the test failed even though the connection was closed as intended. The test bridge now records errors on each upgrade socket and exposes `closed()`, which waits only for `close` and then asserts that any error was `ECONNRESET`. Both launch-deadline tests and the related disposal test, which used the same wait, now use it. The existing pre-deadline `OPEN`, `CLOSED` and `destroyed` assertions are unchanged. This change only touches tests; production behavior is the same. Fixes #21791 ## Confidence High. I reproduced the CI failure on Linux by temporarily making the relay reset its upstream socket (`resetAndDestroy()`) instead of closing it normally: - Old test: both deadline tests fail with the same `Error: read ECONNRESET` seen in CI. - New test: all 35 relay tests pass. With the unmodified relay, all 35 tests pass in 3 consecutive runs, and `compile-tests`, `webpack` and `eslint` pass. Main uncertainty: I haven't run the tests on Windows locally; the extension-unit (Windows) CI job on this PR covers that. How we stop this recurring: tests that wait for a peer socket to close after the relay aborts it should wait for `close` and handle `error` separately. They shouldn't use `events.once(socket, 'close')`, which turns an expected connection reset into a test failure. ## Failure stats (14d, attempt 1) | Scope | Jobs | Failures of this test | Rate | |---|---|---|---| | `main`, Tests / Run VS Code extension unit tests (Windows), first attempt, 2026-10-26 to 2026-11-09 | 153 completed | 3 (2026-11-02, 2026-11-05 ×2) | ~2.0% | The other 3 failures of this job in the window came from unrelated tests: 2 in E2E storage diagnostics and 1 elsewhere. I couldn't read job data for 6 runs. All 3 hits have the same signature: `read ECONNRESET` at `TCP.onStreamRead`, in either the default or the 3000 ms deadline variant. **Verdict: STRONG.** The same signature appeared in 3 independent runs, and the failure reproduces deterministically when the relay's abort is forced to a TCP reset. **🤖 Posted by AspireAgent (AI Agent)** Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> (cherry picked from commit e4763e1)
This comment has been minimized.
This comment has been minimized.
Mitch Denny (mitchdenny)
force-pushed
the
mitchdenny-backport-17-0-33-pr21963
branch
2 times, most recently
from
November 10, 2026 04:24
8c12e08 to
91a79a9
Compare
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22030Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22030" |
Contributor
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Mitch Denny (mitchdenny)
marked this pull request as ready for review
November 10, 2026 05:10
Mitch Denny (mitchdenny)
requested review from
Adam Ratzman (adamint) and
Ella Hathaway (ellahathaway)
as code owners
November 10, 2026 05:10
Member
Author
|
Approved for inclusion in release/17.0. Do not merge yet. |
Mitch Denny (mitchdenny)
force-pushed
the
mitchdenny-backport-17-0-33-pr21963
branch
from
November 10, 2026 05:58
91a79a9 to
8d41852
Compare
This comment has been minimized.
This comment has been minimized.
Mitch Denny (mitchdenny)
force-pushed
the
mitchdenny-backport-17-0-33-pr21963
branch
2 times, most recently
from
November 10, 2026 07:41
91a79a9 to
8d41852
Compare
Contributor
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Mitch Denny (mitchdenny)
force-pushed
the
mitchdenny-backport-17-0-33-pr21963
branch
from
November 10, 2026 08:49
8d41852 to
91a79a9
Compare
Contributor
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
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.
Description
Backport of #21963 to
release/17.0(cherry-picked from e4763e1 with no modifications). Layer 33 of 55 in the release/17.0 backport stack; stacked on #22029.Backport recommendation: No — Extension test flake.
Validation: Stable patch IDs match the original commit. Builds/tests not run for this unchanged cherry-pick.
Backport of #21963
Checklist
<remarks />and<code />elements on your triple slash comments?