Skip to content

[automated] Merge branch 'release/3.1' => 'master' #20150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 26, 2020
Original file line number Diff line number Diff line change
Expand Up @@ -448,22 +448,15 @@ public async Task CanAwaitInvokeFromOnHandlerWithServerClosingConnection()
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());
}
}

Expand Down