Details
-
Task
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
0.20.0
-
None
-
None
Description
Currently the TestNoHangDuringStopFromClientNoDataSendDuringAcceptLoop test in go library can be flaky (fails at roughly 1-in-100 chance)
What this test does is roughly:
- Create a local server listening on a random local port (via localhost:0)
- Create a tcp client that connects to the server (via net.Dial) but does nothing after established the connection (so to server's PoV this is an idle client)
- Tries to shutdown the server
- Verifies that the shutting down of the server took at least the configured timeout, before server forcefully close idle client connections
Step 4 can occasionally (rarely) fail because the server shutdown much faster than expected. I did some digging, the reason seems to be that the client-server tcp connection is broken after established (killed by the os or something?)
So we need to find a way to keep the connection until server kills it to fix the flakiness of this test