Add timeout back to hanging test (#1480)

- Increase timeout to 60 seconds
This commit is contained in:
David Fowler 2018-02-21 21:50:50 -08:00 committed by GitHub
parent 74198712c6
commit 09adc4a847
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -8,7 +8,7 @@ namespace System.Threading.Tasks
{
public static class TaskExtensions
{
private const int DefaultTimeout = 5000;
private const int DefaultTimeout = 1000 * 60;
public static Task OrTimeout(this Task task, int milliseconds = DefaultTimeout, [CallerMemberName] string memberName = null, [CallerFilePath] string filePath = null, [CallerLineNumber] int? lineNumber = null)
{

View File

@ -290,8 +290,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests
logger.LogInformation("Sent message", bytes.Length);
logger.LogInformation("Receiving message");
// No timeout here because it can take a while to receive all the bytes
var receivedData = await receiveTcs.Task;
var receivedData = await receiveTcs.Task.OrTimeout();
Assert.Equal(message, Encoding.UTF8.GetString(receivedData));
logger.LogInformation("Completed receive");
}