Skip to content

Drop stale JDT buffers when a test re-creates a compilation unit - #1640

Merged
ptziegler merged 1 commit into
masterfrom
fix-menucomplextest-stale-buffer
Sep 25, 2026
Merged

ptziegler merged 1 commit into
masterfrom
fix-menucomplextest-stale-buffer

Conversation

@vogella

@vogella vogella commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

MenuComplexTest failed intermittently on Windows CI because the design editor parsed the previous test's source instead of the file on disk. When JDT reads a compilation unit and the open is then cancelled, the buffer stays cached, and deleting and re-creating the file in the next test does not clear it. The test setup now opens and closes each newly created unit, which discards such a leftover buffer. The stale buffer was reproduced on Linux with a forced cancelled open, and MenuComplexTest and the full test suite pass locally, but the Windows flake itself could not be reproduced here, so CI will have to confirm it is gone.

MenuComplexTest failed intermittently on Windows because the editor
parsed the previous test's source instead of the file on disk. If JDT
reads a compilation unit and the open is then cancelled, its buffer
stays cached, and deleting and re-creating the file does not clear it.

Opening and closing each newly created unit in the test setup discards
such a leftover buffer.

Assisted-by: multiple AI agents and layers of automated tooling 🤖
@ptziegler ptziegler linked an issue Sep 24, 2026 that may be closed by this pull request
@ptziegler

Copy link
Copy Markdown
Contributor

It never occurred to me to simply reopen the CU, in order to flush the stale cache. Though I wonder whether that's an issue with the test suite or a genuine bug on the JDT side...
Every now and then, I see a similar problem in the IDE where, after reverting a bunch of changes, the content shown in the Java editor no longer matches the content on the file system. But that's a separate topic.

@github-actions

Copy link
Copy Markdown

Test Results

     4 files  ±0       4 suites  ±0   2h 9m 5s ⏱️ + 1m 55s
 7 022 tests ±0   6 991 ✅  - 1  30 💤 ±0  1 ❌ +1 
23 684 runs  ±0  23 587 ✅  - 1  96 💤 ±0  1 ❌ +1 

For more details on these failures, see this check.

Results for commit 40ee8ed. ± Comparison against base commit a799d4b.

@vogella

vogella commented Sep 25, 2026

Copy link
Copy Markdown
Contributor Author

It never occurred to me to simply reopen the CU, in order to flush the stale cache. Though I wonder whether that's an issue with the test suite or a genuine bug on the JDT side... Every now and then, I see a similar problem in the IDE where, after reverting a bunch of changes, the content shown in the Java editor no longer matches the content on the file system. But that's a separate topic.

Possible. Unfortunately contribution to JDT is difficult. My currently open PRs are not getting any attention, so looking into JDT problems for me is on hold until I see movement in my existing PRs.

@ptziegler

Copy link
Copy Markdown
Contributor

The bane of every open-source project; A continuous lack of time and contributors to review all of the PRs. 😅The test failure seems unrelated, so things are looking good from my perspective.

@ptziegler
ptziegler merged commit 7ff8d33 into master Sep 25, 2026
6 of 8 checks passed
@ptziegler

Copy link
Copy Markdown
Contributor

@vogella Thanks for looking into this! I've been scratching my head at those menu tests for quite a while.

@ptziegler
ptziegler deleted the fix-menucomplextest-stale-buffer branch September 25, 2026 07:00
@ptziegler ptziegler added this to the 1.26.0 milestone Sep 25, 2026
@vogella

vogella commented Sep 25, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @ptziegler for the kind words and the fast merge. I continue to look into the stabilization of the tests, one of the most important foundations for a good contribution flow IMHO.

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.

MenuComplexTest test_showOnlyOneDropDownOnCanvas failed on Windows

2 participants