Repository navigation
Conversation
…ssion which the stop ends The session-tree tests checked that the last 'terminated' stops the debug process by sending a ping on that session's connection, and waiting for the client's answer. But stopping the debug process closes the connections of the sessions, and may close that one before the client answers the ping: the test then waited out its two minutes. It failed so on macOS on main twice today, and on its first run under a full CPU load locally. The test now waits until the debug process is stopping, as it already did for a connection which closes.
|
Warning Review limit reachedThis review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry. Next included review available in 26 minutes. View limit details
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1984 +/- ##
==========================================
+ Coverage 48.38% 48.41% +0.03%
==========================================
Files 810 810
Lines 32612 32611 -1
Branches 6649 6649
==========================================
+ Hits 15778 15790 +12
+ Misses 14325 14315 -10
+ Partials 2509 2506 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
testTheServerIsToldOfTheRenameAfterTheSave failed once on main today, on the IntelliJ 2026.3 runner, after its bound of 10 seconds: the server wasn't told of the rename in time. It passed 15 times out of 15 locally with every CPU busy, and printed nothing when it failed, so it looks like a slow runner rather than a lost notification. The waits of the test now only end a hang, at 60 seconds; a lost notification would still fail it.
lagergren
added a commit
that referenced
this pull request
Nov 21, 2026
…ations that move its last document (#2076) ## What `FileOperationEditSaveTest.testTheServerIsToldOfTheRenameAfterTheSave` failed on the 2025.3 job of #2075 (run 44941700678, attempt 1). It waited 60 seconds for `workspace/didRenameFiles`, which never came. It had failed before, on 2026-11-12, when #1984 raised its wait from 10 to 60 seconds. ## Cause The test renames the only document of its language server, and that document has no editor. Two things happen after the rename, and they race: - **The notification:** `AbstractLSPFileListener` first saves the documents that the `willRenameFiles` edit changed, in an `invokeLater`, and only then sends `didRenameFiles`. - **The stop:** `LSPFileListener` checks in the background whether the moved document is open at its new place. It has no editor there, so it isn't connected again. `stopIfIdle` then stops the language server, which has no document left. In unit-test mode the stop comes at once; otherwise it comes after `lastDocumentDisconnectedTimeout`. When the stop wins, sending `didRenameFiles` starts the language server again. A probe that held the UI thread for 3 seconds after the rename showed it: the server stopped at 3187 ms, `didRenameFiles` arrived at 3210 ms, and the server was started again at 3213 ms. In the failed CI run, the stop's `shutdown` timed out during the test (`Timeout error while shutdown the language server 'mock-server-id'`), and `didRenameFiles` never arrived. ## Fix `afterVfsChange` takes a keep-alive lease (`LanguageServerItem.keepAlive()`) on the language server. It releases the lease once the last `did*` notification of the file operations has been sent; the notifications are sent in order, so the last one goes after the others. The release runs off the dispatcher thread, because it can stop the language server. So when a file operation moves a language server's last document, the server now stops after it's told of the operation, not before, and it isn't started again just to be told. ## Test `FileOperationEditSaveTest.testTheServerIsToldOfTheRenameOfItsLastDocumentBeforeItStops` holds the UI thread for 500 ms after the rename, so that the stop would win. It then checks that the server had one connection when it was told of the rename. Without the fix it had two, because it had been started again. All file-operation, file-move and keep-alive tests pass (118), and so does the full suite (1,808 tests, 0 failures, 7 skipped).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DAPSessionTreeTest.testALiveSessionBelowATerminatedChildKeepsTheDebugSessionRunningfailed twice onmaintoday, both times on macOS: on 358015d at 09:44, and on af306d6 at 11:27. Both times it waited out its 2-minute bound: "the client handles the messages of the sessions".Cause
The test, not the client. To check that the last
terminatedstops the debug process, the test sent a ping on that session's connection and waited for the client's answer. But stopping the debug process closes the connections of the sessions, and may close that one before the client answers the ping. The answer then never comes.It reproduced on its first run locally with all CPUs busy. A thread dump at the hang showed one ping without an answer: the grandchild's, sent after its
terminatedended the last live session. On a fast machine the answer usually goes out first, which is why it passed before. Today's DAP changes (#1965, #1974) changed how fast the connections close on a stop.Change
The three checks that the debug session stops now wait until the debug process is stopping, as the test already did for a connection that closes. The checks that the session keeps running still use the ping, since those connections stay open.
How this was checked
Under the same full CPU load, 10 runs out of 10 pass. Before the change, it hung on the first.
FileOperationEditSaveTest.testTheServerIsToldOfTheRenameAfterTheSaveThe other test that failed on
maintoday, once, on the IntelliJ 2026.3 runner (1224c41). It gave up after its 10-second bound with "the server must be told of the rename", and printed nothing. It passed 15 times out of 15 locally with every CPU busy, so this looks like a slow runner rather than a lost notification. Its waits now only end a hang, at 60 seconds. A notification that really got lost would still fail the test.