File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/Servers/Kestrel/test/FunctionalTests Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -1274,7 +1274,12 @@ await connection.Send("POST / HTTP/1.1",
1274
1274
}
1275
1275
}
1276
1276
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.") ;
1278
1283
1279
1284
// The cancellation token for only the last request should be triggered.
1280
1285
var abortedRequestId = await registrationTcs . Task ;
You can’t perform that action at this time.
0 commit comments