Repository navigation
Accept relay connection reset when waiting for stalled Blazor WASM bridge close - #21963
Merged
Ella Hathaway (ellahathaway) merged 1 commit intoNov 9, 2026
Conversation
The relay aborts an unusable upstream WebSocket opening by destroying its socket. On Windows the test bridge can observe that as ECONNRESET before 'close', and events.once(socket, 'close') rejects on the error event even though the relay behaved correctly. Record bridge upgrade socket errors and wait only for 'close', asserting any error is ECONNRESET. Fixes #21791 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21963Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21963" |
Contributor
Tests selector0 / 101 PR test projects · 2 PR jobs, from 1 changed file. Selected PR test projects (0 / 101)none — no PR-gated .NET test projects run for this change. Selected PR jobs (2)
How these were chosen — grouped by what changedJob reasons
Selection computed for commit |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the test-only change to handle expected connection resets.
No open issues 🎉
What changed in this PR
This test-only change addresses Windows connection-reset failures in the VS Code extension’s Blazor WASM debug relay tests. Production behavior is unchanged.
Changes:
- Record upgrade socket errors and add a
closed()helper that waits for closure while accepting onlyECONNRESETerrors. - Use the helper in both launch-deadline tests and the disposal test, preserving existing state assertions.
| File | Description |
|---|---|
extension/src/test/blazorWasmDebugRelay.test.ts |
Handle expected connection resets when waiting for stalled bridge sockets to close. |
Review effort: Balanced
David Fowler (davidfowl)
marked this pull request as ready for review
November 9, 2026 14:50
David Fowler (davidfowl)
requested review from
Adam Ratzman (adamint) and
Ella Hathaway (ellahathaway)
as code owners
November 9, 2026 14:50
Ella Hathaway (ellahathaway)
approved these changes
Nov 9, 2026
14 tasks
Mitch Denny (mitchdenny)
pushed a commit
that referenced
this pull request
Nov 10, 2026
…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)
Mitch Denny (mitchdenny)
pushed a commit
that referenced
this pull request
Nov 10, 2026
…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)
Mitch Denny (mitchdenny)
pushed a commit
that referenced
this pull request
Nov 10, 2026
…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 was referenced Nov 17, 2026
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.
The VS Code extension unit test
Blazor WASM debug relay closes a stalled bridge upgrade at the … launch deadlinefailed on Windows withError: read ECONNRESET at TCP.onStreamRead(41953320272, 41969207688, 41509624265). The relay behaves correctly: when the launch deadline expires it aborts the stalledwsopening, 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 emitserror(ECONNRESET) beforeclose. The test waited withevents.once(socket, 'close'), andevents.oncerejects when the emitter emitserror, so the test failed even though the connection was closed as intended. The test bridge now records errors on each upgrade socket and exposesclosed(), which waits only forcloseand then asserts that any error wasECONNRESET. Both launch-deadline tests and the related disposal test, which used the same wait, now use it. The existing pre-deadlineOPEN,CLOSEDanddestroyedassertions 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:Error: read ECONNRESETseen in CI.With the unmodified relay, all 35 tests pass in 3 consecutive runs, and
compile-tests,webpackandeslintpass. 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
closeand handleerrorseparately. They shouldn't useevents.once(socket, 'close'), which turns an expected connection reset into a test failure.Failure stats (14d, attempt 1)
main, Tests / Run VS Code extension unit tests (Windows), first attempt, 2026-10-26 to 2026-11-09The 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 ECONNRESETatTCP.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)