Skip to content

Commit f6b1ffa

Browse files
committed
Run debugService.Continue() in the thread pool
So that it doesn't deadlock with the pipeline thread.
1 parent 874e1b8 commit f6b1ffa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/PowerShellEditorServices.Test/Debugging/DebugServiceTests.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ await debugService.SetCommandBreakpointsAsync(
177177
new PSCommand().AddScript("Get-Random -SetSeed 42 -Maximum 100"), CancellationToken.None);
178178

179179
AssertDebuggerStopped("", 1);
180-
debugService.Continue();
180+
await Task.Run(debugService.Continue).ConfigureAwait(true);
181181
Assert.Equal(17, (await executeTask.ConfigureAwait(true))[0]);
182182

183183
StackFrameDetails[] stackFrames = await debugService.GetStackFramesAsync().ConfigureAwait(true);
@@ -296,7 +296,7 @@ public async Task DebuggerStopsOnFunctionBreakpoints()
296296
Assert.Equal("1", i.ValueString);
297297

298298
// The function breakpoint should fire the next time through the loop.
299-
debugService.Continue();
299+
await Task.Run(debugService.Continue).ConfigureAwait(true);
300300
AssertDebuggerStopped(debugScriptFile.FilePath, 6);
301301

302302
variables = await GetVariables(VariableContainerDetails.LocalScopeName).ConfigureAwait(true);
@@ -353,7 +353,7 @@ await debugService.SetLineBreakpointsAsync(
353353

354354
Task _ = ExecuteDebugFileAsync();
355355
AssertDebuggerStopped(debugScriptFile.FilePath, 5);
356-
debugService.Continue();
356+
await Task.Run(debugService.Continue).ConfigureAwait(true);
357357
AssertDebuggerStopped(debugScriptFile.FilePath, 7);
358358
}
359359

@@ -382,7 +382,7 @@ await debugService.SetLineBreakpointsAsync(
382382

383383
// The conditional breakpoint should not fire again, until the value of
384384
// i reaches breakpointValue2.
385-
debugService.Continue();
385+
await Task.Run(debugService.Continue).ConfigureAwait(true);
386386
AssertDebuggerStopped(debugScriptFile.FilePath, 7);
387387

388388
variables = await GetVariables(VariableContainerDetails.LocalScopeName).ConfigureAwait(true);

0 commit comments

Comments
 (0)