Repository navigation
test: the language server asks for its configuration over the connection that it shuts down - #2162
Merged
lagergren merged 1 commit intoNov 23, 2026
Conversation
…ion that it shuts down CancelRequestAfterShutdownTest.testTheAnswerToARequestOfTheLanguageServerIsSentOnceTheShutdownIsSent failed once on macOS 2024.2 (run 45231743923, PR redhat-developer#2160): expected:<[shutdown, ResponseMessage, exit]> but was:<[shutdown, exit]> LSP4IJ answered the request, over another connection. The test stops the language server while its editor is open. A feature of the editor that asks for the language server after the stop, as the code vision does when its first lookup comes late, starts it again over a second connection, as a stop that doesn't disable the language server allows. The mock language server then has two clients, and the test sent workspace/configuration through the last one, the new connection's, which answered it. The connection that the test stops, and whose reads it checks, read only shutdown and exit. The connection now keeps the client that it gives the language server, and the test sends the request through the client of the connection that it stops. It also checks that the request ends with an answer, as isDone() is also true for a request that could not be sent.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2162 +/- ##
==========================================
+ Coverage 53.58% 53.80% +0.21%
==========================================
Files 827 828 +1
Lines 34931 35000 +69
Branches 5469 7213 +1744
==========================================
+ Hits 18717 18830 +113
+ Misses 13425 13377 -48
- Partials 2789 2793 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Collaborator
Author
|
@coderabbitai review |
Action not completed
|
Collaborator
Author
|
@coderabbitai review |
Action performed
|
lagergren
added a commit
that referenced
this pull request
Nov 24, 2026
…rflowed, and retry a refused download for a minute (#2175) ## What Main's last CI run, for 436b029, failed on Windows before any test ran: ``` Could not GET 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugins-bom/2.3.21/kotlin-gradle-plugins-bom-2.3.21.pom'. > Received status code 429 from server: Too Many Requests ``` The job had no cache to start from: setup-gradle said "Gradle User Home cache not found. Will initialize empty.", so it downloaded every dependency again. **Why there was no cache:** the repository's Actions cache holds 12.2 GB, over GitHub's 10 GB per repository. Every entry in it was saved in the 20 minutes before this PR, all on main. The biggest are `gradle-transforms` entries of 3.9, 3.3 and 0.9 GB. They are the IDEs that the IntelliJ Platform Gradle plugin extracts as Gradle artifact transforms, one per job and platform version. Each push to main saves them again for the 5 test jobs, the plugin build and the verifier. GitHub then evicts the oldest entries, the other jobs' downloads among them, and the next run of those jobs fetches everything from Maven Central and JetBrains again. ## Change - **The cache:** every `setup-gradle` step leaves `caches/transforms-4` and `caches/*/transforms` out of the Actions cache, with `gradle-home-cache-excludes`. setup-gradle deletes them before it saves. These are ci.yml, buildZip.yml, IJ.yml, IJ-latest.yml (3 steps), nightly.yml and release.yml. - The downloads themselves stay cached (`gradle-dependencies`, now 1.3 to 2 GB an entry), so the entries fit in 10 GB, and Gradle extracts an IDE again from its cached download without a network access. - Locally the IDEs are in `caches/9.9.2/transforms/*/transformed/extracted`. - **Retries:** Gradle 9.9.2 already retries a download refused with a server error or a 429 (`NetworkingIssueVerifier`), but only 3 times, 1 and 2 seconds apart. `gradle.properties` raises that to 6 times, 2, 4, 8, 16 and 32 seconds apart, with `systemProp.org.gradle.internal.network.retry.max.attempts` and `.initial.backOff`, which `NetworkOperationBackOffAndRetry` reads. A local build prints them back as 6 and 2000 from an init script. ## The other CI failures this week I went through the 22 failed "Java CI with Gradle" runs since 2026-11-17: - **6 were a real break**, fixed by #2138: `InstallerTaskRegistryInitializeTest` failed on every job after #2102. - **Most of the rest were flaky tests, since fixed:** - `LanguageServerManagerInstancesTest` by #2120; - `CancelRequestAfterShutdownTest` by #2162; - `SocketLanguageServerTest` by #2064; - `SelectedEditorConnectionTest` and `FileDocumentMoveTest` by the fixes of #2099 and #2095. - **Seen once and not fixed:** `WatchedFilesTest` (Windows, 2026-11-22) and `LanguageServerInstancesTest` (2026.3, 2026-11-18). - **Since 2026-11-23 14:00 UTC:** 36 runs passed, and the only failure was this 429. ## Check A pull request reads the cache but doesn't write it, so this PR's own CI can't show the saving. After the merge, the next run on main should leave the repository's cache under 10 GB, and the run after it should restore each job's entry. I'll check both.
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.
What
CancelRequestAfterShutdownTest.testTheAnswerToARequestOfTheLanguageServerIsSentOnceTheShutdownIsSent, which came with #2151, failed once on CI, on macOS 2024.2 (run 45231743923, in #2160):It's a bug in the test, not in LSP4IJ or #2151: LSP4IJ did answer the request, but over another connection.
Cause
A restart: the test stops the language server while its editor is open. A stop that doesn't disable the language server lets a feature of the editor start it again, over a second connection (
start()with the statusstopping). The code vision does that when its first lookup of the language servers comes after the stop.The wrong client: the mock language server then has two clients. The test sent
workspace/configurationthrough the last ofgetRemoteProxies(), which was the new connection's, and that connection answered it. The connection that the test stops, and whose reads it checks, read onlyshutdownandexit.Reproduced: under CPU load on macOS, with probes, main failed 2 of 2,100 runs. Each time, the second connection read the answer:
With a 20 ms delay before the code vision's lookup of the language servers, 7 of 100 runs fail. Asking for the file's language servers right after the shutdown is read fails 20 of 20.
Change
isDone()is also true for a request that couldn't be sent.Test
CancelRequestAfterShutdownTest: 8 tests, 0 failures, on IC 2024.2, IC 2025.3 and IU 2026.3.