Clean up flaky MaxRequestBufferSize tests #2225
This commit is contained in:
parent
bcddedc336
commit
333586d735
|
|
@ -86,9 +86,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests
|
||||||
var bytesWrittenPollingInterval = TimeSpan.FromMilliseconds(bytesWrittenTimeout.TotalMilliseconds / 10);
|
var bytesWrittenPollingInterval = TimeSpan.FromMilliseconds(bytesWrittenTimeout.TotalMilliseconds / 10);
|
||||||
var maxSendSize = 4096;
|
var maxSendSize = 4096;
|
||||||
|
|
||||||
// Initialize data with random bytes
|
|
||||||
(new Random()).NextBytes(data);
|
|
||||||
|
|
||||||
var startReadingRequestBody = new TaskCompletionSource<object>();
|
var startReadingRequestBody = new TaskCompletionSource<object>();
|
||||||
var clientFinishedSendingRequestBody = new TaskCompletionSource<object>();
|
var clientFinishedSendingRequestBody = new TaskCompletionSource<object>();
|
||||||
var lastBytesWritten = DateTime.MaxValue;
|
var lastBytesWritten = DateTime.MaxValue;
|
||||||
|
|
@ -300,17 +297,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests
|
||||||
return;
|
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()}");
|
await context.Response.WriteAsync($"bytesRead: {bytesRead.ToString()}");
|
||||||
}))
|
}))
|
||||||
.Build();
|
.Build();
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal;
|
using Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal;
|
||||||
|
using Microsoft.Extensions.Logging.Abstractions;
|
||||||
|
|
||||||
namespace Microsoft.AspNetCore.Testing
|
namespace Microsoft.AspNetCore.Testing
|
||||||
{
|
{
|
||||||
|
|
@ -13,7 +14,7 @@ namespace Microsoft.AspNetCore.Testing
|
||||||
|
|
||||||
public Task<IAdaptedConnection> OnConnectionAsync(ConnectionAdapterContext context)
|
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);
|
return Task.FromResult<IAdaptedConnection>(adapted);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue