Skip to content

Commit 56758c1

Browse files
committed
Fix hangs in DebugAdapterTests
1 parent 3b6cd9c commit 56758c1

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

test/PowerShellEditorServices.Test.Host/DebugAdapterTests.cs

+8-4
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,10 @@ await this.SendRequest(
7676

7777
// Abort script execution
7878
Task terminatedEvent = this.WaitForEvent(TerminatedEvent.Type);
79-
await this.SendRequest(DisconnectRequest.Type, new object());
80-
await terminatedEvent;
79+
await
80+
Task.WhenAll(
81+
this.SendRequest(DisconnectRequest.Type, new object()),
82+
terminatedEvent);
8183
}
8284

8385
[Fact]
@@ -93,8 +95,10 @@ public async Task DebugAdapterReceivesOutputEvents()
9395

9496
// Abort script execution
9597
Task terminatedEvent = this.WaitForEvent(TerminatedEvent.Type);
96-
await this.SendRequest(DisconnectRequest.Type, new object());
97-
await terminatedEvent;
98+
await
99+
Task.WhenAll(
100+
this.SendRequest(DisconnectRequest.Type, new object()),
101+
terminatedEvent);
98102
}
99103

100104
private Task LaunchScript(string scriptPath)

0 commit comments

Comments
 (0)