Browse Source

use dispose async in testhelper

pull/274/head
SimonCropp 7 years ago
committed by Ryan Nowak
parent
commit
5ee3faa856
  1. 4
      test/E2ETest/TestHelpers.cs

4
test/E2ETest/TestHelpers.cs

@ -104,7 +104,7 @@ namespace E2ETest
using var cancellation = new CancellationTokenSource(WaitForServicesTimeout); using var cancellation = new CancellationTokenSource(WaitForServicesTimeout);
try try
{ {
using (cancellation.Token.Register(() => startedTask.TrySetCanceled())) await using (cancellation.Token.Register(() => startedTask.TrySetCanceled()))
{ {
await startedTask.Task; await startedTask.Task;
} }
@ -160,7 +160,7 @@ namespace E2ETest
using var cancellation = new CancellationTokenSource(WaitForServicesTimeout); using var cancellation = new CancellationTokenSource(WaitForServicesTimeout);
try try
{ {
using (cancellation.Token.Register(() => stoppedTask.TrySetCanceled())) await using (cancellation.Token.Register(() => stoppedTask.TrySetCanceled()))
{ {
await stoppedTask.Task; await stoppedTask.Task;
} }

Loading…
Cancel
Save