Skip to content

Commit 25d9e58

Browse files
Skip the attach and prefixed-completion E2E tests on Windows PowerShell
Un-skipping the entire Windows PowerShell E2E suite (now that the host-start hang is fixed) gave us real WinPS coverage for the first time since #2318, but it also surfaced two pre-existing WinPS-specific failures that have nothing to do with host startup: - `CanAttachScriptWithPathMappings` wedges on the in-box, cross-process `Debug-Runspace` attach handshake and rides whatever timeout we set. CI failed it at 10s, then again at exactly 30s after I bumped the budgets, so it genuinely never completes rather than merely running slow. This is the in-box attach deadlock tracked by #2323. - `CanSendCompletionResolveWithModulePrefixRequestAsync` gets an empty completion list from the Windows PowerShell server for a prefix-imported command (it fails before any help assertion, so it's help-independent). That's the same "completion works in PS7 but not WinPS" family as #1355. Because startup no longer hangs, we don't need #2318's discovery-time `[SkippableFactOnWindowsPowerShell]` attribute anymore: an in-body `Skip.If(IsWindowsPowerShell, ...)` runs after `InitializeAsync` (which now starts the server fine) and skips before the broken code, so both tests skip cleanly in ~1ms under `powershell.exe` instead of hanging or failing. This also reverts my earlier timeout bump on `CanAttachScriptWithPathMappings` (back to the 15s/10s/30s budgets from `main`) since the bigger budgets didn't help and the test no longer runs on Windows PowerShell anyway. Everything else stays un-skipped. Drafted by Copilot (Claude Opus 4.8). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent a4e8a82 commit 25d9e58

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

test/PowerShellEditorServices.Test.E2E/DebugAdapterProtocolMessageTests.cs

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

633-
// Generous timeout: the attach handshake and subsequent debugging are
634-
// much slower under Windows PowerShell on constrained CI runners.
635-
[SkippableFact(Timeout = 60000)]
633+
[SkippableFact(Timeout = 15000)]
636634
public async Task CanAttachScriptWithPathMappings()
637635
{
638636
Skip.If(PsesStdioLanguageServerProcessHost.RunningInConstrainedLanguageMode,
639637
"Breakpoints can't be set in Constrained Language Mode.");
640638

639+
Skip.If(PsesStdioLanguageServerProcessHost.IsWindowsPowerShell,
640+
"In-box Windows PowerShell wedges on the cross-process Debug-Runspace attach handshake (see #2323).");
641+
641642
string[] logStatements = ["$PSCommandPath", "after breakpoint"];
642643

643644
await RunWithAttachableProcess(logStatements, async (filePath, processId, runspaceId) =>
@@ -770,7 +771,7 @@ WinPS will always need this.
770771
break
771772
}
772773
773-
if (((Get-Date) - $start).TotalSeconds -gt 30) {
774+
if (((Get-Date) - $start).TotalSeconds -gt 10) {
774775
throw 'Timeout waiting for Debug-Runspace to be subscribed.'
775776
}
776777
@@ -809,9 +810,8 @@ WinPS will always need this.
809810

810811
TaskCompletionSource<int> ridOutput = new();
811812

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));
813+
// Task shouldn't take longer than 30 seconds to complete.
814+
using CancellationTokenSource debugTaskCts = new CancellationTokenSource(TimeSpan.FromSeconds(30));
815815
using CancellationTokenRegistration _ = debugTaskCts.Token.Register(ridOutput.SetCanceled);
816816
using Process? psProc = Process.Start(psi);
817817
try

test/PowerShellEditorServices.Test.E2E/LanguageServerProtocolMessageTests.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1051,9 +1051,12 @@ public async Task CanSendCompletionAndCompletionResolveRequestAsync()
10511051
Assert.Contains(testDescription, updatedCompletionItem.Documentation.String);
10521052
}
10531053

1054-
[Fact]
1054+
[SkippableFact]
10551055
public async Task CanSendCompletionResolveWithModulePrefixRequestAsync()
10561056
{
1057+
Skip.If(PsesStdioLanguageServerProcessHost.IsWindowsPowerShell,
1058+
"Module-prefixed command completion returns no items on the Windows PowerShell server (see #1355).");
1059+
10571060
await PsesLanguageClient
10581061
.SendRequest(
10591062
"evaluate",

0 commit comments

Comments
 (0)