Fix StreamInvocationsBlockOtherInvocationsUntilTheyStartStreaming (#8015)
This commit is contained in:
parent
19fa2635d6
commit
47220cf13e
|
|
@ -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");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue