Add timeout back to hanging test (#1480)
- Increase timeout to 60 seconds
This commit is contained in:
parent
74198712c6
commit
09adc4a847
|
|
@ -8,7 +8,7 @@ namespace System.Threading.Tasks
|
||||||
{
|
{
|
||||||
public static class TaskExtensions
|
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)
|
public static Task OrTimeout(this Task task, int milliseconds = DefaultTimeout, [CallerMemberName] string memberName = null, [CallerFilePath] string filePath = null, [CallerLineNumber] int? lineNumber = null)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -290,8 +290,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests
|
||||||
logger.LogInformation("Sent message", bytes.Length);
|
logger.LogInformation("Sent message", bytes.Length);
|
||||||
|
|
||||||
logger.LogInformation("Receiving message");
|
logger.LogInformation("Receiving message");
|
||||||
// No timeout here because it can take a while to receive all the bytes
|
var receivedData = await receiveTcs.Task.OrTimeout();
|
||||||
var receivedData = await receiveTcs.Task;
|
|
||||||
Assert.Equal(message, Encoding.UTF8.GetString(receivedData));
|
Assert.Equal(message, Encoding.UTF8.GetString(receivedData));
|
||||||
logger.LogInformation("Completed receive");
|
logger.LogInformation("Completed receive");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue