Repository navigation
reenable ConnectTimeout_PlaintextStreamFilterTimesOut_Throws test - #55982
Conversation
|
Tagging subscribers to this area: @dotnet/ncl Issue DetailsI believe the flakiness is caused because in very slow environments (like certain CI machines), the cancellation token may fire before the server accepts the connection, which will cause the server logic to hang. Fix this by using ConnectCallback to avoid creating a real connection at all. Fixes #55931
|
|
/azp run runtime-libraries-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| handler.ServerCertificateCustomValidationCallback = TestHelper.AllowAllCertificates; | ||
| var socketsHandler = GetUnderlyingSocketsHttpHandler(handler); | ||
| socketsHandler.ConnectTimeout = TimeSpan.FromSeconds(1); | ||
| socketsHandler.ConnectCallback = (context, token) => new ValueTask<Stream>(new MemoryStream()); |
There was a problem hiding this comment.
Would this test the connect timeout? In this case, we are already providing "connected" stream, right? e.g. skipping the ConnectAsync or Connect calls.
There was a problem hiding this comment.
Yeah, since we are providing a ConnectCallback, we skip doing the actual ConnectAsync.
|
/azp run runtime-libraries-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
MihaZupan
left a comment
There was a problem hiding this comment.
Nit: The releaseServer TaskCompletionSource isn't needed after this change.
Since we're not connecting, I assume the LoopbackServer could be removed as well.
|
/azp run runtime-libraries-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
I believe the flakiness is caused because in very slow environments (like certain CI machines), the cancellation token may fire before the server accepts the connection, which will cause the server logic to hang.
Fix this by using ConnectCallback to avoid creating a real connection at all.
Fixes #55931