Remove skipped tests and increased timeout for failing test
This commit is contained in:
parent
ebb2ce8fc9
commit
5df022df0c
|
|
@ -217,43 +217,6 @@ namespace Microsoft.AspNetCore.Sockets.Tests
|
||||||
Assert.False(exists);
|
Assert.False(exists);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory(Skip = "Timeouts have not been implemented as yet")]
|
|
||||||
[InlineData("/ws", true)]
|
|
||||||
[InlineData("/sse", false)]
|
|
||||||
[InlineData("/poll", false)]
|
|
||||||
public async Task NeverEndingEndPointCompletesWithTimeoutWhenTransportCloses(string path, bool isWebSocketRequest)
|
|
||||||
{
|
|
||||||
var manager = CreateConnectionManager();
|
|
||||||
var state = manager.CreateConnection();
|
|
||||||
|
|
||||||
var dispatcher = new HttpConnectionDispatcher(manager, new LoggerFactory());
|
|
||||||
|
|
||||||
var context = MakeRequest<NerverEndingEndPoint>(path, state, isWebSocketRequest: isWebSocketRequest);
|
|
||||||
|
|
||||||
var task = dispatcher.ExecuteAsync<NerverEndingEndPoint>("", context);
|
|
||||||
var webSocketTask = Task.CompletedTask;
|
|
||||||
|
|
||||||
Assert.False(task.IsCompleted);
|
|
||||||
|
|
||||||
if (isWebSocketRequest)
|
|
||||||
{
|
|
||||||
var ws = (TestWebSocketConnectionFeature)context.Features.Get<IHttpWebSocketConnectionFeature>();
|
|
||||||
webSocketTask = ws.Client.ExecuteAsync(frame => Task.CompletedTask);
|
|
||||||
await ws.Client.CloseAsync(new WebSocketCloseResult(WebSocketCloseStatus.NormalClosure), CancellationToken.None);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Shut the application down so the transport begins to unwind
|
|
||||||
state.Application.Dispose();
|
|
||||||
|
|
||||||
// Make sure the transport unwinds
|
|
||||||
await state.TransportTask.OrTimeout();
|
|
||||||
|
|
||||||
await webSocketTask.OrTimeout();
|
|
||||||
|
|
||||||
// The task should be cancelled because of the timeout
|
|
||||||
await Assert.ThrowsAsync<TaskCanceledException>(async () => await task.OrTimeout());
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task WebSocketTransportTimesOutWhenCloseFrameNotReceived()
|
public async Task WebSocketTransportTimesOutWhenCloseFrameNotReceived()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -336,7 +336,7 @@ namespace Microsoft.AspNetCore.Sockets.Tests
|
||||||
// End the app
|
// End the app
|
||||||
applicationSide.Dispose();
|
applicationSide.Dispose();
|
||||||
|
|
||||||
await transport.OrTimeout();
|
await transport.OrTimeout(TimeSpan.FromSeconds(10));
|
||||||
|
|
||||||
// We're still in the closed sent state since the client never sent the close frame
|
// We're still in the closed sent state since the client never sent the close frame
|
||||||
Assert.Equal(WebSocketConnectionState.CloseSent, pair.ServerSocket.State);
|
Assert.Equal(WebSocketConnectionState.CloseSent, pair.ServerSocket.State);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue