Merge pull request #20150 from dotnet-maestro-bot/merge/release/3.1-to-master

[automated] Merge branch 'release/3.1' => 'master'
This commit is contained in:
Doug Bunting 2020-03-25 17:12:49 -07:00 committed by GitHub
commit cbc56afea4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 10 deletions

View File

@ -448,22 +448,15 @@ namespace Microsoft.AspNetCore.SignalR.Client.Tests
return Task.CompletedTask;
};
await connection.ReceiveJsonMessage(new { type = HubProtocolConstants.InvocationMessageType, target = "Echo", arguments = new object[] { "42" } });
await connection.ReceiveJsonMessage(new { type = HubProtocolConstants.InvocationMessageType, target = "Echo", arguments = new object[] { "42" } }).OrTimeout();
// Read sent message first to make sure invoke has been processed and is waiting for a response
await connection.ReadSentJsonAsync().OrTimeout();
await connection.ReceiveJsonMessage(new { type = HubProtocolConstants.CloseMessageType });
await connection.ReceiveJsonMessage(new { type = HubProtocolConstants.CloseMessageType }).OrTimeout();
await closedTcs.Task.OrTimeout();
try
{
await tcs.Task.OrTimeout();
Assert.True(false);
}
catch (TaskCanceledException)
{
}
await Assert.ThrowsAsync<TaskCanceledException>(() => tcs.Task.OrTimeout());
}
}