Fix race condition in observer failure test, re-enable remoteServiceBrokerTests#427
Open
Copilot wants to merge 3 commits into
Open
Fix race condition in observer failure test, re-enable remoteServiceBrokerTests#427Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
… observer failure test, re-enable test suite The "with failure end" observer test had a race condition where assert.rejects would catch the inner promise rejection (from the observer's onError callback) before the observeNumbers RPC response arrived. This left a pending response on the service channel's RPC connection, causing a PendingResponseRejected unhandled rejection that bled into subsequent tests. Fix: Restructure the test to await observeNumbers completion before disposing, and add explicit proxy disposal (matching the "with successful end" test pattern). Also re-enable the entire test suite by removing describe.skip. Co-authored-by: AArnott <3548+AArnott@users.noreply.github.com>
…olon prefix Co-authored-by: AArnott <3548+AArnott@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Stabilize and re-enable remoteServiceBrokerTests.ts tests
Fix race condition in observer failure test, re-enable remoteServiceBrokerTests
Feb 24, 2026
There was a problem hiding this comment.
Pull request overview
This PR fixes a race condition in the "with failure end" observer test and re-enables the entire remoteServiceBrokerTests.ts test suite that was disabled in PR #372 due to consistent CI failures.
Changes:
- Re-enabled the test suite by removing
describe.skip/*unstable*/ - Fixed race condition in the "with failure end" observer test by changing from
assert.rejectspattern to explicit error collection - Added proper disposal ordering (
proxy?.dispose()beforebroker.dispose()) to match the pattern in "with successful end" test
AArnott
approved these changes
Feb 24, 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 entire
remoteServiceBrokerTests.tssuite was disabled (describe.skip) in #372 due to consistent failures in CI.Root cause
The "with failure end" observer test had a race condition:
assert.rejectscaught the inner promise rejection (from the observer'sonErrorcallback) before theobserveNumbersRPC response arrived. The test then proceeded to dispose resources while asendRequestpromise was still pending in vscode-jsonrpc'sresponsePromisesmap. On channel teardown,dispose()rejected these orphaned promises, producing unhandled rejections that bled into the next test block.Changes
describe.skip/*unstable*/observeNumberscompletion before disposing, eliminating the race between promise rejection and RPC response arrival. Add explicitproxy?.dispose()beforebroker.dispose()(matching the "with successful end" test).Before (races):
After:
Verified stable across 20 consecutive runs.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
xofvsblobprodwus2114.vsblob.vsassets.io/opt/hostedtoolcache/dotnet/dotnet dotnet build test/ServiceBrokerTest/ServiceBrokerTest.csproj -c Release(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.