Skip to content

Commit bbc6eb5

Browse files
Lower ReadScriptLogLineAsync cap below per-test xUnit timeout
The internal `CancelAfter` cap was 15s, exactly equal to the `[SkippableFact(Timeout = 15000)]` on `CanAttachScriptWithPathMappings`. Because xUnit's per-test timer covers the whole test -- attach, setBreakpoints, configurationDone and waiting for stopped events all run before `ReadScriptLogLineAsync` is even entered -- xUnit's generic timeout would almost always fire first, so the descriptive `TimeoutException` naming the log path would never surface for the very test that motivated it. Drop the cap to 10s so the clearer message can win for that test, while still bounding the untimed `[Fact]` callers. Per review feedback from copilot-pull-request-reviewer on #2318. Drafted by Copilot (Claude Opus 4.8). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent ce985b7 commit bbc6eb5

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

test/PowerShellEditorServices.Test.E2E/DebugAdapterProtocolMessageTests.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,11 @@ private async Task<string> ReadScriptLogLineAsync(CancellationToken cancellation
225225
// the test fails fast with a clear message instead of spinning
226226
// forever -- a busy-spin here previously pegged the CPU and starved
227227
// xUnit's cooperative test timeout, hanging CI for the full six hours.
228+
// Keep this cap meaningfully below the tightest per-test xUnit
229+
// `Timeout` (15s on `CanAttachScriptWithPathMappings`) so this
230+
// descriptive message wins instead of xUnit's generic timeout.
228231
using CancellationTokenSource timeoutCts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
229-
timeoutCts.CancelAfter(TimeSpan.FromSeconds(15));
232+
timeoutCts.CancelAfter(TimeSpan.FromSeconds(10));
230233
CancellationToken token = timeoutCts.Token;
231234

232235
try

0 commit comments

Comments
 (0)