Skip to content

test: ResolvedCodeActionTest.testUndoRevertsTheResolvedEditAlone failed once on IntelliJ 2026.1.5.2: the resolved edit wasn't applied #2315

Done

Description

@lagergren

What happened

ResolvedCodeActionTest.testUndoRevertsTheResolvedEditAlone failed once, in the nightly's new job for IntelliJ IDEA
2026.1.5.2 (job, on a fork, on the
branch of #2042, which doesn't change this test or the code it runs):

com.redhat.devtools.lsp4ij.features.codeAction.ResolvedCodeActionTest testUndoRevertsTheResolvedEditAlone FAILED
    junit.framework.ComparisonFailure: expected:<[hello ]world!> but was:<[]world!>
        at com.redhat.devtools.lsp4ij.features.codeAction.ResolvedCodeActionTest.testUndoRevertsTheResolvedEditAlone(ResolvedCodeActionTest.java:56)

Line 56 is the first assertion. After the intention ran and the events were dispatched, the resolved edit (hello )
wasn't in the document.

It hasn't been reproduced:

  • The class passed 3 times out of 3 locally, headless, on 2026.1.5.2.
  • It passes in every CI job of build: require IntelliJ 2025.1 #2042: 2025.1 on Linux, Windows and macOS, 2025.3, and 2026.3.
  • It isn't among the failures of the last 40 failed runs of ci.yml, nor of the nightly.

What's known

  • The reply isn't late. In test mode, LSPLazyCodeActionIntentionAction.invoke resolves the code action
    synchronously (resolveCodeAction(…).get(10 s)). It then applies it with invokeLater(applyResolved), which the
    test's PlatformTestUtil.dispatchAllEventsInIdeEventQueue() should run.

  • Only two checks can refuse the edit. The edit has no document version (WorkspaceEdit.changes). So
    WorkspaceEditSnapshot.validate only checks:

    • that the document's synchronizer, modification sequence and stamp, captured in invoke, still match;
    • that the connection is the same.

    If either check fails, it shows an error hint and doesn't apply the edit. That gives exactly world!.

  • Not known yet: what could change between invoke and applyResolved in this test, or whether the invokeLater
    ran at all.

Next

Make a failing run say why:

  • record whether applyResolved ran and the reason it refused the edit, and assert it with a message;
  • wait with a bound for the edit, instead of after one event dispatch.

A rerun of the failing case on CI would then show which check refused it.

Activity

  1. added a commit that references this issue on Nov 28, 2026
    e768c6a
  2. 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

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions