Skip to content

test: make order deterministic in LanguageServerTest - #1635

Merged
rubenporras merged 3 commits into
eclipse-lsp4e:mainfrom
rubenporras:test_order
Oct 28, 2026
Merged

rubenporras merged 3 commits into
eclipse-lsp4e:mainfrom
rubenporras:test_order

Conversation

@rubenporras

Copy link
Copy Markdown
Contributor

No description provided.

testComputeFirst and testComputeAll expected server 0 to answer first
because it slept 1 s and server 1 slept 2 s. LSP4E sends a request to
a server only once that server has started and opened the document, so
on a slow CI agent server 0 could receive the hover more than 1 s after
server 1, and HoverContent1 arrived first.

Let server 0 answer immediately and server 1 only once the test has the
first result, so the order no longer depends on timing.
testComputeFirstSkipsEmptyResults/testComputeFirstTreatsEmptyListAsNull
delayed the answer of server 1 by 2 s so that the empty answer of
server 0 came first.

Let server 1 answer once server 0 has answered
instead, which keeps that order without the artificial fixed delay, and
reduces the combined execution time almost 4 seconds.
@rubenporras
rubenporras merged commit d89bec0 into eclipse-lsp4e:main Oct 28, 2026
11 checks passed
@rubenporras
rubenporras deleted the test_order branch October 28, 2026 08:52
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