From 5df022df0c530a218dc7b691413bf96e43b98c30 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Tue, 4 Apr 2017 22:13:12 -0700 Subject: [PATCH] Remove skipped tests and increased timeout for failing test --- .../HttpConnectionDispatcherTests.cs | 37 ------------------- .../WebSocketsTests.cs | 2 +- 2 files changed, 1 insertion(+), 38 deletions(-) diff --git a/test/Microsoft.AspNetCore.Sockets.Tests/HttpConnectionDispatcherTests.cs b/test/Microsoft.AspNetCore.Sockets.Tests/HttpConnectionDispatcherTests.cs index f55d813f49..c7a1772d26 100644 --- a/test/Microsoft.AspNetCore.Sockets.Tests/HttpConnectionDispatcherTests.cs +++ b/test/Microsoft.AspNetCore.Sockets.Tests/HttpConnectionDispatcherTests.cs @@ -217,43 +217,6 @@ namespace Microsoft.AspNetCore.Sockets.Tests 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(path, state, isWebSocketRequest: isWebSocketRequest); - - var task = dispatcher.ExecuteAsync("", context); - var webSocketTask = Task.CompletedTask; - - Assert.False(task.IsCompleted); - - if (isWebSocketRequest) - { - var ws = (TestWebSocketConnectionFeature)context.Features.Get(); - 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(async () => await task.OrTimeout()); - } - [Fact] public async Task WebSocketTransportTimesOutWhenCloseFrameNotReceived() { diff --git a/test/Microsoft.AspNetCore.Sockets.Tests/WebSocketsTests.cs b/test/Microsoft.AspNetCore.Sockets.Tests/WebSocketsTests.cs index 47a89eda83..d7a35ee38f 100644 --- a/test/Microsoft.AspNetCore.Sockets.Tests/WebSocketsTests.cs +++ b/test/Microsoft.AspNetCore.Sockets.Tests/WebSocketsTests.cs @@ -336,7 +336,7 @@ namespace Microsoft.AspNetCore.Sockets.Tests // End the app 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 Assert.Equal(WebSocketConnectionState.CloseSent, pair.ServerSocket.State);