Corrected spelling of "canceled". Put .OrTimeout() on every await call.
This commit is contained in:
parent
9bb59b2ec6
commit
793559af98
|
|
@ -393,7 +393,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests
|
||||||
testHttpHandler.OnNegotiate(async (request, cancellationToken) =>
|
testHttpHandler.OnNegotiate(async (request, cancellationToken) =>
|
||||||
{
|
{
|
||||||
// Wait here for the test code to cancel the "outer" token
|
// Wait here for the test code to cancel the "outer" token
|
||||||
await negotiateSyncPoint.WaitToContinue();
|
await negotiateSyncPoint.WaitToContinue().OrTimeout();
|
||||||
|
|
||||||
// Cancel
|
// Cancel
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
|
|
@ -411,9 +411,9 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests
|
||||||
|
|
||||||
// Wait for the connection to get to the "WaitToContinue" call above,
|
// Wait for the connection to get to the "WaitToContinue" call above,
|
||||||
// which means it has gotten to Negotiate
|
// which means it has gotten to Negotiate
|
||||||
await negotiateSyncPoint.WaitForSyncPoint();
|
await negotiateSyncPoint.WaitForSyncPoint().OrTimeout();
|
||||||
|
|
||||||
// Assert that StartAsync has not yet been cancelled
|
// Assert that StartAsync has not yet been canceled
|
||||||
Assert.False(startTask.IsCanceled);
|
Assert.False(startTask.IsCanceled);
|
||||||
|
|
||||||
// Cancel StartAsync, then "release" the SyncPoint
|
// Cancel StartAsync, then "release" the SyncPoint
|
||||||
|
|
@ -421,8 +421,8 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests
|
||||||
cts.Cancel();
|
cts.Cancel();
|
||||||
negotiateSyncPoint.Continue();
|
negotiateSyncPoint.Continue();
|
||||||
|
|
||||||
// Assert that StartAsync was cancelled
|
// Assert that StartAsync was canceled
|
||||||
await Assert.ThrowsAsync<OperationCanceledException>(() => startTask);
|
await Assert.ThrowsAsync<OperationCanceledException>(() => startTask).OrTimeout();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue