Skip to content

Commit 918dc51

Browse files
committed
Merge in 'release/2.1' changes
2 parents 97ee5cb + 019ba08 commit 918dc51

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Servers/Kestrel/test/FunctionalTests/RequestTests.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1274,7 +1274,12 @@ await connection.Send("POST / HTTP/1.1",
12741274
}
12751275
}
12761276

1277-
await Assert.ThrowsAsync<TaskCanceledException>(async () => await readTcs.Task);
1277+
var thrownEx = await Assert.ThrowsAnyAsync<Exception>(async () => await readTcs.Task);
1278+
1279+
// https://github.com/aspnet/AspNetCore-Internal/issues/1521
1280+
// In more recent versions of Kestrel, we expect this to always be a TaskCanceledException,
1281+
// but without the changes in https://github.com/aspnet/KestrelHttpServer/pull/2844, this is flaky.
1282+
Assert.True(thrownEx is TaskCanceledException || thrownEx is IOException, $"{thrownEx} is neither a TaskCanceledException nor IOException.");
12781283

12791284
// The cancellation token for only the last request should be triggered.
12801285
var abortedRequestId = await registrationTcs.Task;

0 commit comments

Comments
 (0)