Repository navigation
Test Explorer fsharp tag from the project's language (#604), 20-attach reliability test, unpredictable sidecar endpoints - #607
Merged
Conversation
…s each pause it and detach without killing it; the attach suite's shared helpers move into debug-attach-kit
…and tested in both tiers
…ndom nonce into the root/pid/counter hash, 16 hex digits, so no local process can predict and pre-bind it
…s name looks like Expecto or FsCheck (#604): every F# test is tagged, no C# test is; the name-guessing helpers are deleted
MelbourneDeveloper
enabled auto-merge (squash)
November 19, 2026 14:55
…'s own error lines (NU1101 …) instead of only the project path; the C# gate is proven to open no workspace until the project is repaired
…hat terminal on open, instead of firing the close before anyone listens and leaving a ghost terminal beside the next run
MelbourneDeveloper
added a commit
that referenced
this pull request
Nov 19, 2026
…sts flake) (#610) ## TLDR A cancelled Test Explorer Debug gesture no longer leaves a leftover "SharpLsp Test Debug" terminal beside the next debug run. This is the cause of the repeated Linux `debug-tests` failures (`the cancelled gesture leaves no ghost terminal beside the live debug run`, `2 !== 1`). ## Details - `test-debug.ts`: - **An already-cancelled gesture opens no terminal.** It runs nothing worth showing. - **A run's end disposes its terminal window.** Firing the pty's close event alone only reaches a terminal VS Code has opened. On headless Linux, VS Code may never open the pty of a short-lived run, so its terminal stayed open. - #607's open-time close stays, for a run that ends while its terminal is opening. - Live runs are unchanged: the terminal still opens, stays live while the debugger attaches, and closes when the run ends. ## How Do The Automated Tests Prove It Works? - `debug-test-stop-e2e.test.ts` *Stop ends its host and terminal, never retries, and the next Debug starts clean* (F# and C#, VSTest and MTP) asserts exactly one test-debug terminal after a pre-cancelled gesture. - It failed on Linux CI on the first run of #606, #607 and #609 with `2 !== 1`. - CI on this PR is the proof, because it always passed locally on macOS. - Locally: the `debug-test-mtp`, `debug-test-stop`, `debug-terminal-cancel` and `debug-test-debugging` suites pass, 35 tests. - `test-explorer-outcomes.test.ts` still asserts that the Debug profile opens exactly one live terminal for a real run.
MelbourneDeveloper
added a commit
that referenced
this pull request
Nov 19, 2026
…mpt (Linux debug-inspection wedge) (#614) ## TLDR The 20-attach reliability test (added in #607) stops wedging Linux `debug-inspection`. Each attempt now attaches to its own fresh process and pauses the session that attach started. ## Details - **Failure** (#613, Linux `debug-inspection`): attempt 2's `stopDebuggee` timed out after 45 s. The stuck session then failed every later suite in the chunk, 12 failures in all. - **Mechanism, from the uploaded debugger trace:** - Attempt 1 attached, paused and detached in 0.2 s. - Attempt 2's attach was accepted, but no `pause` was ever sent. `startAttached` returns `vscode.debug.activeDebugSession`, which still named attempt 1's ending session. `pauseAttached` polled `threads` on that dead session until its 60-second limit. - Meanwhile the fixture's 30-second `wait` ran out. The process exited (`exited` code 0 at +29 s), and the session never settled in time. - Separately, 20 attaches to ONE 30-second fixture cannot fit on a slow runner: the attaches took 15 s locally, but CI is slower. - **Fix** (test only, no product change): - Every attempt starts a fresh fixture process. After the detach the test asserts that process is still alive, then kills it. - The attempt's session comes from `DebugSessionRecorder`, by its start index, never from `activeDebugSession`. - New end-of-test assertions: exactly 20 sessions started, and every one ended. ## How Do The Automated Tests Prove It Works? - `debug-attach-reliability-e2e.test.ts` *at least 19 of 20 attaches pause a live process, and every detach leaves it running* passes locally: 20/20 in 21 s, with every pause stop recorded and a clean session. - `debug-attach-e2e.test.ts` still passes (5 tests). - On this PR, Linux `debug-inspection` runs the test after the rest of the chunk, at CI speed.
MelbourneDeveloper
added a commit
that referenced
this pull request
Nov 19, 2026
…ile watcher (Windows F# add-file hover) (#613) ## TLDR Adding an F# file from the Solution Explorer now reloads the F# project right away. Before, the reload waited for the file watcher to notice the host's own `.fsproj` write; on Windows it sometimes didn't, and the new file stayed unowned, with no hover or diagnostics. ## Details - **Symptom:** the Windows `workspace` leg failed on #607, #609 and #612 in *Solution Explorer — Add F# Source File: project node: adds .fs before the last Compile item and FCS owns it*. A hover on the new file stayed `[]` for the test's 90-second polling limit. Each failure passed on re-run. - **Mechanism, from the uploaded host and sidecar logs of a passing run:** - `sharplsp/project/addCompileItem` edits the `.fsproj` through the C# sidecar's MSBuild editing. - Nothing then told the F# sidecar. Its reload ("F# loaded …fsproj, which owns …NewLogic.fs") came about 1.8 s later, only because the native watcher noticed the write. - The Windows logs show watcher `EPERM` and "watcher shutdown" errors. When the event is lost, the project is never reloaded. - **Fix:** - `pull_diagnostics/monitor.rs` gains `written(paths)`. It posts the same `workspace/didChangeWatchedFiles` notification the native watcher sends (type Changed, `sharplspRescan: false`) onto the foreground dispatch queue. - `project_edit.rs` calls it after any compile-item edit that modified the project. - A watcher event that also arrives is merged into the same reload by the existing reload worker. - `pull_diagnostics/state.rs` exposes the dispatch queue (`inbound()`). Both files stay under 500 lines. ## How Do The Automated Tests Prove It Works? - `written_tests::a_project_file_the_host_writes_is_announced_as_a_watched_change` (new) checks three cases: 1. Before the dispatch queue exists, the call is a no-op. 2. Once the queue exists, one `didChangeWatchedFiles` arrives, carrying exactly `[{ uri: <project>, type: 2 }]` with `sharplspRescan: false`. 3. Writing no paths sends no notification. - All 371 host unit tests pass (`--test-threads=1`), and clippy is clean. - On this PR, the Windows `workspace` leg runs the Add F# Source File suite end to end.
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.
TLDR
Fixes the Test Explorer's
fsharptag (#604), adds a test that attaches 20 times in a row, makes sidecar endpoint names unpredictable, and ticks the plan rows these prove.Details
fsharptag (test-language.ts, new):fsharpwhen an.fsprojbuilt it. The project is the one the listing names; otherwise it is the nearest project file above the assembly's output folder.PropertyTestswas tagged F#.isExpectoTestandisFsCheckTesthave no remaining production use, so they are deleted.assertLeafItem,assertPlainLeaf,assertSnapshotUriShape,assertTaggedFor) now take each row's expected language tag instead of asserting "no tag". This change was made with the fix, as the issue asked.sidecar/manager/launch.rs):getrandom(the OS's secure random source) into the root/pid/counter hash.getrandom0.4 was already inCargo.lockthrough other crates.WorkspaceRestore.cs): a failed workspace restore now reports the SDK's ownerrorlines (e.g.NU1101: Unable to find package …) and falls back to the tail of the output. Before, it said only "Package restore failed for ".debug-attach-reliability-e2e.test.ts, new): attaches 20 times to one running process. Each attach must pause the process and detach without killing it. The attach suite's shared helpers move intodebug-attach-kit.ts.How Do The Automated Tests Prove It Works?
test-explorer-fsharp-frameworks.test.ts: every Expecto and FsCheck row must carry exactly['fsharp'].calculator.adds two numbers carries exactly the tags of its project's language (#604)(actual[]).test-explorer-frameworks.test.ts,test-explorer-e2e.test.ts,test-explorer-netfx.test.ts,real-repo-netfx-fsharp.test.ts: F# xUnit, NUnit and MSTest rows carryfsharp, and C# rows carry no tag.test-language.test.tsuses real folders:PropertyTests.csprojresolves to C#;.fsprojresolves to F#;WorkspaceRestoreGateTests(new) uses a package missing from an empty local feed:launch.rs:endpoint_tokens_are_unpredictable_and_constant_length: 64 random values, all distinct and non-zero; 64 tokens for the same root, all distinct and all 16 hex digits.same_workspace_managers_get_distinct_ipc_endpointsstill passes.debug-attach-reliability-e2e.test.ts: 20/20 attaches locally in 15 s, and the existing attach suite still passes (5 passing).