Repository navigation
Conversation
akurtakov
force-pushed
the
wait-for-language-servers
branch
2 times, most recently
from
December 3, 2026 05:09
69990b0 to
3c1d5d3
Compare
Several tests slept 2 to 10 seconds to give the language server time to start. Add Utils.waitForLanguageServer(), which waits until the server is running and connected to the document, and until all the other servers of the document are initialized, and fails the test otherwise. Use it instead of those sleeps and of the copies of the same wait in TestAstro and TestMarkdown, two of which did not check the result. Waiting for all servers matters because requests through LanguageServers.forDocument() wait for every server of the document, e.g. ESLint next to JS/TS, and time out while one is still starting. The rename tests also wait until the server highlights all occurrences, as inline rename collects them with a 1 second documentHighlight request and only renames the one at the caret if it times out. Assisted-by: Anthropic Claude Code (claude-opus-5-5)
akurtakov
force-pushed
the
wait-for-language-servers
branch
from
December 3, 2026 05:17
3c1d5d3 to
98b42ec
Compare
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.
Several tests slept 2 to 4 seconds (10 seconds in total in TestAngular) to give the language server time to start before editing the document or sending requests.
This adds
Utils.waitForLanguageServer(document, serverId, timeout), which waits until the given server is running and connected to the document, and until all the other servers of the document are initialized. If that does not happen in time, it fails the test with a clear message. It replaces:Notes:
LanguageServers.forDocument()wait for every server of the document, e.g. ESLint next to JS/TS. They time out while one is still starting.documentHighlightrequest, and only renames the occurrence at the caret if that times out.The 1.5 s sleeps waiting for preference changes to reach the server are left as they are.
Locally (Linux) all 62 tests pass. The changed test classes pass 3 runs pinned to a single CPU, which reproduced the earlier Jenkins failures before these fixes. In those classes the waits save about 14 s compared with the sleeps.