From 4b9a3fcc057dad82a18504d97e7715bf18814dc0 Mon Sep 17 00:00:00 2001 From: John Luo Date: Mon, 15 Oct 2018 18:46:36 -0700 Subject: [PATCH 1/2] Skip falky tests caused by https://github.com/dotnet/corefx/issues/30691 --- .../MaxRequestBufferSizeTests.cs | 9 ++++++++- test/Kestrel.Transport.FunctionalTests/ResponseTests.cs | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/test/Kestrel.Transport.FunctionalTests/MaxRequestBufferSizeTests.cs b/test/Kestrel.Transport.FunctionalTests/MaxRequestBufferSizeTests.cs index 4768e6060e..a506c01527 100644 --- a/test/Kestrel.Transport.FunctionalTests/MaxRequestBufferSizeTests.cs +++ b/test/Kestrel.Transport.FunctionalTests/MaxRequestBufferSizeTests.cs @@ -14,6 +14,7 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Testing; +using Microsoft.AspNetCore.Testing.xunit; using Microsoft.Extensions.Logging.Testing; using Xunit; @@ -22,7 +23,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests public class MaxRequestBufferSizeTests : LoggedTest { // The client is typically paused after uploading this many bytes: - // + // // OS MaxRequestBufferSize (MB) connectionAdapter Transport min pause (MB) max pause (MB) // --------------- ------------------------- ----------------- --------- -------------- -------------- // Windows 10 1803 1 false Libuv 1.7 3.3 @@ -100,7 +101,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests } } + private bool LargeUploadRetryPredicate(Exception e) + => e is IOException && e.Message.Contains("Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request"); + [Theory] + [RetryTest(nameof(LargeUploadRetryPredicate), + "Active investigation into potential corefx sockets bug: https://github.com/dotnet/corefx/issues/30691", + OperatingSystems.Windows)] [MemberData(nameof(LargeUploadData))] public async Task LargeUpload(long? maxRequestBufferSize, bool connectionAdapter, bool expectPause) { diff --git a/test/Kestrel.Transport.FunctionalTests/ResponseTests.cs b/test/Kestrel.Transport.FunctionalTests/ResponseTests.cs index 539f701cab..63601abebf 100644 --- a/test/Kestrel.Transport.FunctionalTests/ResponseTests.cs +++ b/test/Kestrel.Transport.FunctionalTests/ResponseTests.cs @@ -17,12 +17,13 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Server.Kestrel.Core; -using Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal; using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.AspNetCore.Server.Kestrel.Https; using Microsoft.AspNetCore.Server.Kestrel.Https.Internal; using Microsoft.AspNetCore.Testing; +using Microsoft.AspNetCore.Testing.xunit; using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Testing; using Microsoft.Extensions.Primitives; using Moq; using Xunit; @@ -802,7 +803,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests Assert.False(requestAborted); } + private bool ConnectionNotClosedWhenClientSatisfiesMinimumDataRateGivenLargeResponseHeadersRetryPredicate(Exception e) + => e is IOException && e.Message.Contains("Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request"); + [Fact] + [RetryTest(nameof(ConnectionNotClosedWhenClientSatisfiesMinimumDataRateGivenLargeResponseHeadersRetryPredicate), + "Active investigation into potential corefx sockets bug: https://github.com/dotnet/corefx/issues/30691", + OperatingSystems.Windows)] public async Task ConnectionNotClosedWhenClientSatisfiesMinimumDataRateGivenLargeResponseHeaders() { var headerSize = 1024 * 1024; // 1 MB for each header value From 06dbdf5ced0844ef2b8206468b5ee8080415a32d Mon Sep 17 00:00:00 2001 From: John Luo Date: Mon, 15 Oct 2018 19:05:19 -0700 Subject: [PATCH 2/2] Increase retry count --- .../MaxRequestBufferSizeTests.cs | 3 ++- test/Kestrel.Transport.FunctionalTests/ResponseTests.cs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test/Kestrel.Transport.FunctionalTests/MaxRequestBufferSizeTests.cs b/test/Kestrel.Transport.FunctionalTests/MaxRequestBufferSizeTests.cs index a506c01527..5090e6d530 100644 --- a/test/Kestrel.Transport.FunctionalTests/MaxRequestBufferSizeTests.cs +++ b/test/Kestrel.Transport.FunctionalTests/MaxRequestBufferSizeTests.cs @@ -107,7 +107,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests [Theory] [RetryTest(nameof(LargeUploadRetryPredicate), "Active investigation into potential corefx sockets bug: https://github.com/dotnet/corefx/issues/30691", - OperatingSystems.Windows)] + OperatingSystems.Windows, + 5)] [MemberData(nameof(LargeUploadData))] public async Task LargeUpload(long? maxRequestBufferSize, bool connectionAdapter, bool expectPause) { diff --git a/test/Kestrel.Transport.FunctionalTests/ResponseTests.cs b/test/Kestrel.Transport.FunctionalTests/ResponseTests.cs index 63601abebf..3b50a8071b 100644 --- a/test/Kestrel.Transport.FunctionalTests/ResponseTests.cs +++ b/test/Kestrel.Transport.FunctionalTests/ResponseTests.cs @@ -809,7 +809,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests [Fact] [RetryTest(nameof(ConnectionNotClosedWhenClientSatisfiesMinimumDataRateGivenLargeResponseHeadersRetryPredicate), "Active investigation into potential corefx sockets bug: https://github.com/dotnet/corefx/issues/30691", - OperatingSystems.Windows)] + OperatingSystems.Windows, + 5)] public async Task ConnectionNotClosedWhenClientSatisfiesMinimumDataRateGivenLargeResponseHeaders() { var headerSize = 1024 * 1024; // 1 MB for each header value