Skip to content

WillSaveTest fails on IntelliJ 2026.2: willSaveWaitUntil stops being sent before three answers came too late #2317

Done

Description

@lagergren

What happens

On IntelliJ IDEA 2026.2.5.1, WillSaveTest.testEditsThatComeTooLateAreDroppedAndTheRequestStopsAfterThreeTimeouts fails
every time:

junit.framework.AssertionFailedError: after three timeouts, willSaveWaitUntil is no longer sent for the document
expected:<3> but was:<1>
    at com.redhat.devtools.lsp4ij.WillSaveTest.testEditsThatComeTooLateAreDroppedAndTheRequestStopsAfterThreeTimeouts(WillSaveTest.java:94)

No CI job ran the tests on 2026.2 before #2316 made LSP4IJ build against it, so this is the first run.

What the test checks

The server answers willSaveWaitUntil too late four times. LSP4IJ sends willSaveWaitUntil until three answers have
come too late, and then no more for that document. So of the four saves, three send it.

On 2026.2, the four saves happen (the wait for four didSave passes), but willSaveWaitUntil is sent only once or
twice. LSP4IJ stops sending it sooner than the test expects. Possibly 2026.2 calls LSP4IJ's before-save handling more
than once per save, so that one save counts as more than one late answer. That isn't checked yet.

Why it may matter to users

If the cause is in LSP4IJ and not only in the test, a user on 2026.2 whose language server answers willSaveWaitUntil
slowly gets its edits before a save for fewer saves than intended. Users of other versions aren't affected.

Next

Find out how often, and from where, the save calls LSP4IJ's willSave handling on 2026.2 compared with 2026.3. Then fix
LSP4IJ or the test, whichever is wrong.

Activity

  1. added
    bug
    on Nov 27, 2026
  2. lagergren commented on Nov 27, 2026

    @lagergren
    CollaboratorAuthor

    A correction, from the investigation in #2319: this isn't only 2026.2. The test fails the same way on 2026.1.5.2, and the cause is in LSP4IJ, not in the test. It affects IntelliJ 2025.3 and later: since 2025.3, IntelliJ's UI scheduler holds back the invokeLater runnable that ends the willSaveWaitUntil budget while a background write action, such as a document commit, runs. A save in that window can then skip willSaveWaitUntil. 2026.3 passes by timing. #2319 has the trace and the fix.

  3. added this to the 0.30.2 milestone on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugjunit-test

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions