From 42056d27d218067bf4dab745dd4fde436eacccdd Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Tue, 21 Apr 2020 15:44:02 +1200 Subject: [PATCH] =?UTF-8?q?Remove=20flaky=20FlowControl=5FParallelStreams?= =?UTF-8?q?=5FFirstInFirstOutOrder=E2=80=A6=20(#21037)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Http2/Http2ConnectionTests.cs | 135 ------------------ 1 file changed, 135 deletions(-) diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs index 8212a68451..452ad4bb90 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs @@ -60,141 +60,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests await StopConnectionAsync(expectedLastStreamId: 1, ignoreNonGoAwayFrames: false); } - [Fact] - [QuarantinedTest] - public async Task FlowControl_ParallelStreams_FirstInFirstOutOrder() - { - // The test will: - // 1. Create a stream with a large response. It will use up the connection window and complete. - // 2. Create two streams will smaller responses. - // 3. Update the connection window one byte at a time. - // 4. Read from them in a FIFO order until they are each complete. - - // Ensure there that all backpressure is due to connection flow control, not the pipe. - _serviceContext.ServerOptions.Limits.MaxResponseBufferSize = long.MaxValue; - // Ensure there that all backpressure is due to connection flow control, not stream flow control. - _clientSettings.InitialWindowSize = int.MaxValue; - - await InitializeConnectionAsync(c => - { - var responseBodySize = Convert.ToInt32(c.Request.Headers["ResponseBodySize"]); - return c.Response.Body.WriteAsync(new byte[responseBodySize]).AsTask(); - }); - - // Consume the entire connection output flow control window with a large response. - await StartStreamAsync(1, GetHeaders(responseBodySize: 65535), endStream: true); - - await ExpectAsync(Http2FrameType.HEADERS, - withLength: 32, - withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, - withStreamId: 1); - await ExpectAsync(Http2FrameType.DATA, - withLength: 16384, - withFlags: (byte)Http2DataFrameFlags.NONE, - withStreamId: 1); - await ExpectAsync(Http2FrameType.DATA, - withLength: 16384, - withFlags: (byte)Http2DataFrameFlags.NONE, - withStreamId: 1); - await ExpectAsync(Http2FrameType.DATA, - withLength: 16384, - withFlags: (byte)Http2DataFrameFlags.NONE, - withStreamId: 1); - await ExpectAsync(Http2FrameType.DATA, - withLength: 16383, - withFlags: (byte)Http2DataFrameFlags.NONE, - withStreamId: 1); - await ExpectAsync(Http2FrameType.DATA, - withLength: 0, - withFlags: (byte)Http2DataFrameFlags.END_STREAM, - withStreamId: 1); - - await StartStreamAsync(3, GetHeaders(responseBodySize: 3), endStream: true); - - await ExpectAsync(Http2FrameType.HEADERS, - withLength: 2, - withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, - withStreamId: 3); - - await StartStreamAsync(5, GetHeaders(responseBodySize: 3), endStream: true); - - await ExpectAsync(Http2FrameType.HEADERS, - withLength: 2, - withFlags: (byte)Http2HeadersFrameFlags.END_HEADERS, - withStreamId: 5); - - await SendWindowUpdateAsync(streamId: 0, 1); - - // FIFO means stream 3 returns data first - await ExpectAsync(Http2FrameType.DATA, - withLength: 1, - withFlags: (byte)Http2DataFrameFlags.NONE, - withStreamId: 3); - - await SendWindowUpdateAsync(streamId: 0, 1); - - // Stream 5 data - await ExpectAsync(Http2FrameType.DATA, - withLength: 1, - withFlags: (byte)Http2DataFrameFlags.NONE, - withStreamId: 5); - - await SendWindowUpdateAsync(streamId: 0, 1); - - // Stream 3 data - await ExpectAsync(Http2FrameType.DATA, - withLength: 1, - withFlags: (byte)Http2DataFrameFlags.NONE, - withStreamId: 3); - - await SendWindowUpdateAsync(streamId: 0, 1); - - // Stream 5 data - await ExpectAsync(Http2FrameType.DATA, - withLength: 1, - withFlags: (byte)Http2DataFrameFlags.NONE, - withStreamId: 5); - - await SendWindowUpdateAsync(streamId: 0, 1); - - // Stream 3 data - await ExpectAsync(Http2FrameType.DATA, - withLength: 1, - withFlags: (byte)Http2DataFrameFlags.NONE, - withStreamId: 3); - - // Stream 3 ends - await ExpectAsync(Http2FrameType.DATA, - withLength: 0, - withFlags: (byte)Http2DataFrameFlags.END_STREAM, - withStreamId: 3); - - await SendWindowUpdateAsync(streamId: 0, 1); - - // Stream 5 data - await ExpectAsync(Http2FrameType.DATA, - withLength: 1, - withFlags: (byte)Http2DataFrameFlags.NONE, - withStreamId: 5); - - await ExpectAsync(Http2FrameType.DATA, - withLength: 0, - withFlags: (byte)Http2DataFrameFlags.END_STREAM, - withStreamId: 5); - - await StopConnectionAsync(expectedLastStreamId: 5, ignoreNonGoAwayFrames: false); - - IEnumerable> GetHeaders(int responseBodySize) - { - foreach (var header in _browserRequestHeaders) - { - yield return header; - } - - yield return new KeyValuePair("ResponseBodySize", responseBodySize.ToString()); - } - } - [Fact] public async Task FlowControl_OneStream_CorrectlyAwaited() {