Skip to content

Commit

Permalink
Quarantine and fix Http1Connection_RequestEndsWithIncompleteReadAsync (
Browse files Browse the repository at this point in the history
  • Loading branch information
halter73 committed Sep 19, 2024
1 parent 00d8c03 commit e25539b
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ await connection.ReceiveEnd(
}

[Fact]
[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/57944")]
public async Task Http1Connection_RequestEndsWithIncompleteReadAsync()
{
var testMeterFactory = new TestMeterFactory();
Expand All @@ -171,7 +172,12 @@ public async Task Http1Connection_RequestEndsWithIncompleteReadAsync()
await using var server = new TestServer(async context =>
{
var result = await context.Request.BodyReader.ReadAsync();
await context.Response.BodyWriter.WriteAsync(result.Buffer.ToArray());
// The request body might be incomplete, but there should be something in the first read.
Assert.True(result.Buffer.Length > 0);
Assert.Equal(result.Buffer.ToSpan(), "Hello World?"u8[..(int)result.Buffer.Length]);
await context.Response.WriteAsync("Hello World?");
// No BodyReader.Advance. Connection will fail when attempting to complete body.
}, serviceContext);

Expand Down

0 comments on commit e25539b

Please sign in to comment.