mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Help deflake TestTCPConfirmNeighborReachability
...by not assuming that the NUD event is available immediately after receiving the readable signal from the TCP endpoint. The readable signal may be triggered before the NUD event is sent. PiperOrigin-RevId: 512120289
This commit is contained in:
committed by
gVisor bot
parent
6e425b0c57
commit
6526c169cd
@@ -1093,15 +1093,10 @@ func (d *nudDispatcher) OnNeighborRemoved(nicID tcpip.NICID, entry stack.Neighbo
|
||||
}
|
||||
|
||||
func (d *nudDispatcher) expectEvent(want eventInfo) error {
|
||||
select {
|
||||
case got := <-d.c:
|
||||
if diff := cmp.Diff(want, got, cmp.AllowUnexported(eventInfo{}), cmpopts.IgnoreFields(stack.NeighborEntry{}, "UpdatedAt")); diff != "" {
|
||||
return fmt.Errorf("got invalid event (-want +got):\n%s", diff)
|
||||
}
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("event didn't arrive")
|
||||
if diff := cmp.Diff(want, <-d.c, cmp.AllowUnexported(eventInfo{}), cmpopts.IgnoreFields(stack.NeighborEntry{}, "UpdatedAt")); diff != "" {
|
||||
return fmt.Errorf("got invalid event (-want +got):\n%s", diff)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// TestTCPConfirmNeighborReachability tests that TCP informs layers beneath it
|
||||
|
||||
Reference in New Issue
Block a user