You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LanguageServerProcessNodesTest.testADisposedLanguageServerExpiresItsCannotStartNotification fails at times: it disposes the language server before the server keeps its notification #2330
LanguageServerProcessNodesTest.testADisposedLanguageServerExpiresItsCannotStartNotification failed once on Linux, in the first CI run of #2328, which doesn't touch the LSP console. It passed on Windows, 2025.3 and 2026.3 in the same run.
junit.framework.AssertionFailedError
at com.redhat.devtools.lsp4ij.console.LanguageServerProcessNodesTest.testADisposedLanguageServerExpiresItsCannotStartNotification(LanguageServerProcessNodesTest.java:597)
Line 597 asserts that disposing the language server whose start failed expired its "Cannot start server" notification.
Cause: the test
LanguageServerWrapper.showNotificationStartServerError shows the notification (CancellationSupport.showNotificationError, which notifies the bus) and only then keeps it in errorNotification. It does so on the thread of the failed start. The test waits until the notification is shown, so it can dispose the language server in between. Its dispose then finds no notification to expire. The thread of the start expires it right after, when it sees that the language server was disposed, but the test has asserted by then.
The product handles this: a dispose expires the notification it keeps, and a notification shown during a dispose is expired once it is kept. testACannotStartNotificationShownWhileItsLanguageServerIsDisposedExpires covers that second case, and waits for the expiry.
Proof
With a temporary pause of one second between the notification and errorNotification = notification, the test fails every time at line 597, as on CI.
Fix
The test waits until the failed start reports its error (LanguageServerLifecycleListener.handleError), which it does after it kept the notification, before it disposes the language server. It still asserts that the dispose expires the notification at once.
Activity