Repository navigation
test: TemplateJarRefreshActivityTest finds its JAR also once another test has listed the temp directory - #2361
Merged
lagergren merged 1 commit intoNov 30, 2026
Conversation
…test has listed the temp directory Each test built its JAR in a new folder of the temp directory and looked it up without a refresh. Once another test of the same JVM had listed the temp directory, the VFS didn't look for the new folder on disk, and the first assertTemplates failed, as on IntelliJ 2025.3 in a CI run of redhat-developer#2355. The first build of a test's JAR is now looked up with a refresh, as the IDE knows the JAR from which it read the templates at its previous start. Fixes redhat-developer#2360
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2361 +/- ##
==========================================
- Coverage 58.86% 58.84% -0.03%
==========================================
Files 849 849
Lines 36719 36719
Branches 5767 7609 +1842
==========================================
- Hits 21614 21606 -8
- Misses 12102 12103 +1
- Partials 3003 3010 +7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Fixes #2360
TemplateJarRefreshActivityTestfailed on IntelliJ 2025.3 in a CI run of #2355, which doesn't touch the templates: its three tests that build a JAR, at their firstassertTemplates. Onetest:commit, for contributors only; no change to LSP4IJ itself. For 0.30.2.Cause: the test
Each test built its JAR in a new folder of the temp directory, then looked it up with
JarFileSystem.findFileByPath, without a refresh. The VFS looks on disk for a file it hasn't seen yet only in a folder whose children it hasn't listed yet. So once another test of the same JVM had listed the temp directory, the VFS didn't find the new folder, andassertTemplatesfailed at line 167. Which tests share a JVM, and in which order they run, varies with CI's three test forks.LSP4IJ itself isn't affected:
TemplateJarRefreshActivitylooks up LSP4IJ's own JAR, which the VFS knows from the IDE's previous start.Fix
The first build of a test's JAR is looked up with
refreshAndFindFileByNioFile, as the IDE knows the JAR from which it read the templates at its previous start. The later builds aren't refreshed, so that the tests still see what the VFS has cached of the old JAR.Proof
With the temp directory listed in
setUp(getChildren()of its VFS file) before the test creates its folder, on macOS:testGetTemplateRootNeverRefreshespassesTemplateJarRefreshActivity.refreshOncetestTheTemplatesOfARebuiltJarAreNewAfterTheRefreshandtestItRefreshesOnlyOnceForAllProjectsfail at the templates they find, so the tests still need the product's refreshWithout the listing, headless, with the counts from the JUnit XMLs:
TemplateJarRefreshActivityTest