Skip to content

Commit a8cc3b2

Browse files
committed
Fix up WinPS assertion
1 parent aa58144 commit a8cc3b2

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

test/PowerShellEditorServices.Test.E2E/DebugAdapterProtocolMessageTests.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,12 @@ await RunWithAttachableProcess(logStatements, async (filePath, processId) =>
585585

586586
// Wait until we hit the breakpoint
587587
stoppedEvent = await nextStoppedTask;
588-
Assert.Equal("breakpoint", stoppedEvent.Reason);
588+
589+
// WinPS has a bug on attach where it doesn't send the breakpoints on the stop event.
590+
string expectedReason = PsesStdioLanguageServerProcessHost.IsWindowsPowerShell
591+
? "step"
592+
: "breakpoint";
593+
Assert.Equal(expectedReason, stoppedEvent.Reason);
589594

590595
// The code before the breakpoint should have already run
591596
// It will contain the actual script being run
@@ -664,7 +669,7 @@ private async Task RunWithAttachableProcess(string[] logStatements, Func<string,
664669
# Keep running until the runner has deleted the test script to
665670
# ensure the process doesn't finish before the test does in
666671
# normal circumstances.
667-
while (Test-Path -Path $TestScript) {
672+
while (Test-Path -LiteralPath $TestScript) {
668673
Start-Sleep -Seconds 1
669674
}
670675
";
@@ -703,7 +708,7 @@ private async Task RunWithAttachableProcess(string[] logStatements, Func<string,
703708
};
704709
psi.EnvironmentVariables["TERM"] = "dumb"; // Avoids color/VT sequences in test output.
705710

706-
// Task shouldn't take longer than 10 seconds to complete.
711+
// Task shouldn't take longer than 30 seconds to complete.
707712
using CancellationTokenSource debugTaskCts = new CancellationTokenSource(TimeSpan.FromSeconds(30));
708713
using Process psProc = Process.Start(psi);
709714
try

0 commit comments

Comments
 (0)