p2p (#4119): treat slow discover v5 tests (#4122)
* configure a 50 ms timeout for tests (like v4 tests) * use in-memory DB (like v4 tests) * TestUDPv5_callTimeoutReset: improve speed from 1.2s to 0.2s * TestUDPv5_callTimeoutReset: reduce the likelihood of "RPC timeout" * move lookup tests to the "integration" suite * log details of unmatched packets and sends to non-existing nodes * fix flaky TestUDPv5_findnodeHandling: Table.nextRevalidateTime was random (from 0 to 10s). Sometimes it triggered doRevalidate immediately, and it produced an unexpected ping. Configure a high interval to not revalidate during the tests. Time improved from 1.7s to 0.2s. Test with: go test ./p2p/discover -run TestUDPv5 -count 1
Showing
- p2p/discover/common.go 7 additions, 2 deletionsp2p/discover/common.go
- p2p/discover/table.go 16 additions, 12 deletionsp2p/discover/table.go
- p2p/discover/table_util_test.go 12 additions, 4 deletionsp2p/discover/table_util_test.go
- p2p/discover/v4_udp.go 2 additions, 2 deletionsp2p/discover/v4_udp.go
- p2p/discover/v4_udp_test.go 2 additions, 0 deletionsp2p/discover/v4_udp_test.go
- p2p/discover/v5_lookup_test.go 120 additions, 0 deletionsp2p/discover/v5_lookup_test.go
- p2p/discover/v5_udp.go 6 additions, 4 deletionsp2p/discover/v5_udp.go
- p2p/discover/v5_udp_test.go 65 additions, 129 deletionsp2p/discover/v5_udp_test.go
Loading
Please register or sign in to comment