Fix TestTCPTimeWaitNewSyn.

Drain the notification channel after first accept as in case the first accept
never blocked then the notification for the first accept will still be in the
channel causing the second accept to fail as it will try to wait on the channel
and return immediately due to the older notification even though there is no
connection yet in the accept queue.

PiperOrigin-RevId: 338710062
This commit is contained in:
Bhasker Hariharan
2020-10-23 11:20:49 -07:00
committed by gVisor bot
parent 685ceca98b
commit f73fad834f
+7
View File
@@ -6725,6 +6725,13 @@ func TestTCPTimeWaitNewSyn(t *testing.T) {
c.CheckNoPacketTimeout("unexpected packet received in response to SYN", 1*time.Second)
// drain any older notifications from the notification channel before attempting
// 2nd connection.
select {
case <-ch:
default:
}
// Send a SYN request w/ sequence number higher than
// the highest sequence number sent.
iss = seqnum.Value(792)