Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Clean up flaky MaxRequestBufferSize tests #2497

Merged
merged 1 commit into from
Apr 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions test/Kestrel.FunctionalTests/MaxRequestBufferSizeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ public async Task LargeUpload(long? maxRequestBufferSize, bool connectionAdapter
var bytesWrittenPollingInterval = TimeSpan.FromMilliseconds(bytesWrittenTimeout.TotalMilliseconds / 10);
var maxSendSize = 4096;

// Initialize data with random bytes
(new Random()).NextBytes(data);

var startReadingRequestBody = new TaskCompletionSource<object>();
var clientFinishedSendingRequestBody = new TaskCompletionSource<object>();
var lastBytesWritten = DateTime.MaxValue;
Expand Down Expand Up @@ -300,17 +297,6 @@ private IWebHost StartWebHost(long? maxRequestBufferSize,
return;
}

// Verify bytes received match expectedBody
for (int i = 0; i < expectedBody.Length; i++)
{
if (buffer[i] != expectedBody[i])
{
context.Response.StatusCode = StatusCodes.Status500InternalServerError;
await context.Response.WriteAsync($"Bytes received do not match expectedBody at position {i}");
return;
}
}

await context.Response.WriteAsync($"bytesRead: {bytesRead.ToString()}");
}))
.Build();
Expand Down
3 changes: 2 additions & 1 deletion test/shared/PassThroughConnectionAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal;
using Microsoft.Extensions.Logging.Abstractions;

namespace Microsoft.AspNetCore.Testing
{
Expand All @@ -13,7 +14,7 @@ public class PassThroughConnectionAdapter : IConnectionAdapter

public Task<IAdaptedConnection> OnConnectionAsync(ConnectionAdapterContext context)
{
var adapted = new AdaptedConnection(new LoggingStream(context.ConnectionStream, new TestApplicationErrorLogger()));
var adapted = new AdaptedConnection(new LoggingStream(context.ConnectionStream, NullLogger.Instance));
return Task.FromResult<IAdaptedConnection>(adapted);
}

Expand Down