Skip to content

Intermittent WebFilterQuickFixTest failures in CI #1697

Closed

Description

@lagergren

WebFilterQuickFixTest.testWebFilterQuickFix intermittently fails in CI. This issue tracks stabilizing the test and restoring any temporarily disabled platform coverage.

The latest failure is on macOS in #1696, at 9960b789:
https://github.com/redhat-developer/lsp4ij/actions/runs/38578151701/job/115901976918

java.lang.AssertionError: Add the `servletNames` attribute to @WebFilter
expected:<[Add the `urlPatterns` attribute to @WebFilter]> but was:<[]>
    at WebFilterQuickFixTest.testWebFilterQuickFix(WebFilterQuickFixTest.java:29)

Linux and Windows passed in that run. The earlier revision of the same PR passed on all three platforms: https://github.com/redhat-developer/lsp4ij/actions/runs/38575391481

The same test also failed on main before this PR:

These are different failure signatures in the same test; I have not established whether they share a root cause. The historical Linux failure also means the instability is not necessarily macOS-specific.

I ran the test against unmodified current main (f3825955) locally on macOS with JDK 21, and it passed with no skips. I do not have a deterministic reproducer. The targeted command is:

NO_FS_ROOTS_ACCESS_CHECK=true ./gradlew test \
  --tests com.redhat.devtools.lsp4ij.features.codeAction.WebFilterQuickFixTest \
  --rerun-tasks --no-build-cache

The CI workflow runs ./gradlew check. This test uses the mock language-server connection, rather than the OS process provider changed in #1696.

The temporary macOS-only skip proposed in #1696 has been removed to keep that PR focused on the process-lifetime fix. This test remains enabled on all platforms. A fresh targeted local run on macOS passed after restoring it, but the intermittent CI failure remains unresolved and is tracked here separately.

Potentially related: #294 reports intermittently missing quick fixes in MicroProfile/Jakarta integration. I did not find an issue specifically tracking this CI test failure, and have not confirmed a shared cause with #294.

Activity

  1. lagergren commented on Oct 19, 2026

    @lagergren
    CollaboratorAuthor

    An update on this flake. I don't have a fix yet, but I do have a deterministic reproduction of one of its signatures, plus a lead and a dead end.

    Recent failures

    It is the most frequent test failure in CI right now. It failed in 9 runs between 2026-10-16 and 2026-10-19, on several branches, with all three signatures from the description:

    Run Branch OS Signature
    38964144380 feat/diagnostic-update-hook Ubuntu Unable to highlight after 1000 retries
    38964126921 feat/workspace-diagnostics macOS Unable to highlight after 1000 retries
    38964827145 feat/diagnostic-update-hook macOS AssertionFailedError
    38964726635 feat/workspace-diagnostics macOS Unable to highlight after 1000 retries
    38966790927 feat/workspace-diagnostics macOS AssertionFailedError
    38974966603 feat/workspace-diagnostics Ubuntu expected:<[Add the `urlPatterns` attribute to @WebFilter]> but was:<[]>
    39145132978 fix/format-without-editor macOS AssertionFailedError
    39226878129 main macOS AssertionFailedError
    39229949835 fix/inline-completion-context macOS Unable to highlight after 1000 retries

    Reproduction of the AssertionFailedError

    The mock server publishes diagnostics from its didOpen handler. Delaying that by one second makes the test fail every time with the AssertionFailedError signature, in LSPCodeActionFixtureTestCase.assertCodeActions's assertNotEmpty(actions), called from WebFilterQuickFixTest.java:29. The delay goes in MockTextDocumentService.didOpen:

    var probeDiagnostics = this.publishDiagnostics;
    CompletableFuture.delayedExecutor(1, TimeUnit.SECONDS)
            .execute(() -> publishDiagnostics(new PublishDiagnosticsParams(uri, probeDiagnostics)));

    So the test depends on when the diagnostics arrive relative to myFixture.doHighlighting() in getAllQuickFixes(). Nothing in the fixture waits for them.

    What did not work

    I made the fixture wait before highlighting until the file's OpenedDocument held the diagnostics, then called NonBlockingReadActionImpl.waitForAsyncTaskCompletion() so that LSPDiagnosticsApplier could set its highlighters. That fails even without the delay. Right before doHighlighting() the editor's markup had no highlights, and doHighlighting() returned no infos.

    In editor mode, LSPDiagnosticsPassFactory.createHighlightingPass returns null; the diagnostics are applied reactively by LSPDiagnosticsApplier. So my guess is that the passing runs depend on the diagnostics, and their application, landing while doHighlighting() runs, and that waiting first loses them. I haven't confirmed that. The but was:<[]> signature, where quick fixes exist but none is available, and the Unable to highlight after 1000 retries signature are not reproduced.

  2. lagergren commented on Oct 19, 2026

    @lagergren
    CollaboratorAuthor

    Found and fixed in #1717, which closes this issue when it merges.

    • Unable to highlight after 1000 retries, and but was:<[]>: a race in LSPLazyCodeActions. Highlighting passes run in parallel, and two of them could load the same quick fixes at once. The second load cancelled the first request before it was sent. If that cancelled request stayed stored, every later use either rethrew ProcessCanceledException from ShowIntentionsPass or reported "no code action" for good.
    • AssertionFailedError with no quick fixes: a race in LSPCodeActionFixtureTestCase. It highlighted only once, so it depended on the diagnostics arriving during that single highlighting.

    With the test repeated 150 times in one JVM, unchanged main failed twice and had 8 double loads. With #1717 there were no failures and no double loads. #1719 tracks two related problems that #1717 leaves as they are.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions