Skip to content

Conversation

@hero5512
Copy link
Contributor

@hero5512 hero5512 commented Oct 24, 2025

The test was intermittently failing because PING packets from background node revalidation sometimes arrived before the expected NEIGHBORS response. The failure can be seen in https://github.com/ethereum/go-ethereum/actions/runs/18759496644/job/53520537257.

--- FAIL: TestUDPv4_findnode (0.02s)
v4_udp.go:532: TRACE[10-23|19:33:31.361] >> PING/v4 id=e91c8fbf09909f1e addr=10.13.0.1:2000 err=
v4_udp.go:583: TRACE[10-23|19:33:31.368] << FINDNODE/v4 id=2ba2870c5c54644f addr=10.0.1.99:30303 err=
v4_udp.go:532: TRACE[10-23|19:33:31.368] >> NEIGHBORS/v4 id=2ba2870c5c54644f addr=10.0.1.99:30303 err=
v4_udp_test.go:285: sent packet type mismatch, got: *v4wire.Ping, want: *v4wire.Neighbors
FAIL
FAIL    github.com/ethereum/go-ethereum/p2p/discover   15.589s

@fjl
Copy link
Contributor

fjl commented Oct 24, 2025

You can simplify the implementation by using test.waitPacketOut(func(p v4wire.Packet, ... and performing a switch inside of the function. This is preferable to inlining waitPacketOut.

@hero5512 hero5512 force-pushed the fix-discover-datarace branch from d59105d to 88fb682 Compare October 24, 2025 16:40
@hero5512
Copy link
Contributor Author

You can simplify the implementation by using test.waitPacketOut(func(p v4wire.Packet, ... and performing a switch inside of the function. This is preferable to inlining waitPacketOut.

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants