Skip to content

Commit a4e8a82

Browse files
Increase CanAttachScriptWithPathMappings timeouts on slow CI runners
This PR un-skips `CanAttachScriptWithPathMappings` on Windows PowerShell (reverting the #2318 skips now that the host-start hang is fixed), and the un-skipped test promptly failed on the WinPS 5.1 CI leg with "Attached process exited before the script could start" -- at exactly 10 seconds. The test spawns a child `powershell.exe`, then waits up to 10s for `Debug-Runspace` to subscribe to the child's runspace as the marker that the attach handshake completed, before driving a full breakpoint/continue interaction under a 15s xUnit timeout. On the 2-vCPU CI runners the WinPS attach alone exceeds that 10s budget, so the child throws its internal timeout and exits before the debug session attaches. It isn't even close to comfortable locally: xUnit flags the run as a long-running test at the 10s mark on a fast dev box, so the old budget was always on a knife's edge for the slower WinPS path. Rather than re-skip it, give the slow-but-correct path room: - The child's `Debug-Runspace` subscription poll goes 10s -> 30s. - The outer process-watch cancellation goes 30s -> 60s. - The xUnit `Timeout` goes 15s -> 60s. This continues 81b273b (which already bumped the xUnit timeout 10s -> 15s for the same flakiness) and keeps real coverage of the attach path on Windows PowerShell instead of skipping it. See #2323 and #2318. Drafted by Copilot (Claude Opus 4.8). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0eb8b3f commit a4e8a82

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

test/PowerShellEditorServices.Test.E2E/DebugAdapterProtocolMessageTests.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,9 @@ public async Task CanLaunchScriptWithNewChildAttachSessionAsJob()
630630
await terminatedTcs.Task;
631631
}
632632

633-
[SkippableFact(Timeout = 15000)]
633+
// Generous timeout: the attach handshake and subsequent debugging are
634+
// much slower under Windows PowerShell on constrained CI runners.
635+
[SkippableFact(Timeout = 60000)]
634636
public async Task CanAttachScriptWithPathMappings()
635637
{
636638
Skip.If(PsesStdioLanguageServerProcessHost.RunningInConstrainedLanguageMode,
@@ -768,7 +770,7 @@ WinPS will always need this.
768770
break
769771
}
770772
771-
if (((Get-Date) - $start).TotalSeconds -gt 10) {
773+
if (((Get-Date) - $start).TotalSeconds -gt 30) {
772774
throw 'Timeout waiting for Debug-Runspace to be subscribed.'
773775
}
774776
@@ -807,8 +809,9 @@ WinPS will always need this.
807809

808810
TaskCompletionSource<int> ridOutput = new();
809811

810-
// Task shouldn't take longer than 30 seconds to complete.
811-
using CancellationTokenSource debugTaskCts = new CancellationTokenSource(TimeSpan.FromSeconds(30));
812+
// Task shouldn't take longer than 60 seconds to complete (it is
813+
// much slower under Windows PowerShell on constrained CI runners).
814+
using CancellationTokenSource debugTaskCts = new CancellationTokenSource(TimeSpan.FromSeconds(60));
812815
using CancellationTokenRegistration _ = debugTaskCts.Token.Register(ridOutput.SetCanceled);
813816
using Process? psProc = Process.Start(psi);
814817
try

0 commit comments

Comments
 (0)