…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.
What
LanguageServerManagerInstancesTest.testAStartWithARootStartsNoOtherStoppedInstancefailed on Windows (run 45060985654, on #2092):stop(b)waited 60 s for the instance to be stopped.Verdict: the test is wrong, not LSP4IJ. It stops an instance with a plain
stop(), which doesn't switch it off, while the instance's new editor still has background requests pending, and any request for an open file starts such a server again, as intended.Cause
Opening a file in an editor makes two background requests for it:
ConnectDocumentToLanguageServerSetupParticipant), after waiting for indexing, which can be up to about a second late;LSPCodeLensProvider).Either can end after the test's own request. When one ended after the test had stopped the instance, it started the instance again.
Change
Test only:
SelectedEditorConnectionTestdoes;openAndConnectwaits until the tab has connected the file before making its own request.This also covers
testEnableAndStartOfAnInstanceWhichFailedStartsDisabledStartsNoOtherStoppedInstance, which has the same exposure.Test
SelectedEditorConnectionTestandLanguageServerInstancesTestpass 3 runs of 127 tests each.