Fix StreamInvocationsBlockOtherInvocationsUntilTheyStartStreaming (#8015)

This commit is contained in:
BrennanConroy 2019-02-28 09:23:33 -08:00 committed by GitHub
parent 19fa2635d6
commit 47220cf13e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 7 deletions

View File

@ -335,7 +335,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests
logger.LogInformation("Receiving message");
// Big timeout here because it can take a while to receive all the bytes
var receivedData = await connection.Transport.Input.ReadAsync(bytes.Length);
var receivedData = await connection.Transport.Input.ReadAsync(bytes.Length).OrTimeout(TimeSpan.FromMinutes(2));
Assert.Equal(message, Encoding.UTF8.GetString(receivedData));
logger.LogInformation("Completed receive");
}

View File

@ -2668,21 +2668,18 @@ namespace Microsoft.AspNetCore.SignalR.Tests
var hubActivator = serviceProvider.GetService<IHubActivator<LongRunningHub>>() as CustomHubActivator<LongRunningHub>;
// OnConnectedAsync and SimpleMethod hubs have been disposed at this point
Assert.Equal(2, hubActivator.ReleaseCount);
await client.SendHubMessageAsync(new CancelInvocationMessage(streamInvocationId)).OrTimeout();
// Completion message for canceled Stream
await client.ReadAsync().OrTimeout();
// Stream method is now disposed
Assert.Equal(3, hubActivator.ReleaseCount);
// Shut down
client.Dispose();
await connectionHandlerTask.OrTimeout();
// OnConnectedAsync, SimpleMethod, LongRunningStream, OnDisconnectedAsync
Assert.Equal(4, hubActivator.ReleaseCount);
}
}
}