Fix ContentLength_Received_ReadViaPipes (#8893)

This commit is contained in:
Justin Kotalik 2019-03-28 14:14:36 -07:00 committed by GitHub
parent 248d4e70a2
commit a5791da8d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -1016,14 +1016,18 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests
Assert.IsType<Http2StreamErrorException>(thrownEx.InnerException); Assert.IsType<Http2StreamErrorException>(thrownEx.InnerException);
} }
[ConditionalFact] [Fact]
[SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/7000
public async Task ContentLength_Received_ReadViaPipes() public async Task ContentLength_Received_ReadViaPipes()
{ {
await InitializeConnectionAsync(async context => await InitializeConnectionAsync(async context =>
{ {
var readResult = await context.Request.BodyReader.ReadAsync(); var readResult = await context.Request.BodyReader.ReadAsync();
Assert.True(readResult.IsCompleted); while (!readResult.IsCompleted)
{
context.Request.BodyReader.AdvanceTo(readResult.Buffer.Start, readResult.Buffer.End);
readResult = await context.Request.BodyReader.ReadAsync();
}
Assert.Equal(12, readResult.Buffer.Length); Assert.Equal(12, readResult.Buffer.Length);
context.Request.BodyReader.AdvanceTo(readResult.Buffer.End); context.Request.BodyReader.AdvanceTo(readResult.Buffer.End);