mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
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:
committed by
gVisor bot
parent
685ceca98b
commit
f73fad834f
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user