Skip to content

test: match language client stop errors by code across the extension bundle - #1957

Merged
eitsupi merged 2 commits into
mainfrom
test/language-client-stop-error-code
Nov 17, 2026
Merged

eitsupi merged 2 commits into
mainfrom
test/language-client-stop-error-code

Conversation

@eitsupi

@eitsupi eitsupi commented Nov 17, 2026

Copy link
Copy Markdown
Member

The Interactive editor suite's suiteTeardown failed on Windows with "Pending response rejected since connection got disposed" while stopping language clients.

stopLanguageClient already accepts this error when the client has stopped, but it matched it with instanceof ResponseError. The clients under test come from the extension bundle, which includes its own copy of vscode-languageclient, so their ResponseError is a different class from the one the test imports and the check never matched. It now matches the error code instead. A new test rejects a stop with an error of another class that carries the same code.

@eitsupi
eitsupi marked this pull request as ready for review November 17, 2026 15:12

@renkun-ken renkun-ken left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed commit f9061b8. No actionable findings.

Matching PendingResponseRejected by code correctly handles the extension bundle's separate ResponseError constructor while retaining the Error and State.Stopped guards. The new regression fixture fails with the original helper and passes with this change; I also confirmed the same behavior with an actual separately bundled vscode-jsonrpc ResponseError. Existing rejection handling still propagates unrelated failures and errors from unstopped clients.

Validation: compilation, TypeScript checks, changed-file lint/format checks, and all four focused Interactive language client cleanup tests passed locally on macOS with VS Code 1.145.2. Hosted Windows and Ubuntu extension tests, all three Node jobs, and build/lint/format/typecheck checks have passed. The macOS extension job is still in progress at review time.

@eitsupi
eitsupi merged commit e5ee1b8 into main Nov 17, 2026
14 of 17 checks passed
@eitsupi
eitsupi deleted the test/language-client-stop-error-code branch November 17, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants