From 6769b383fbe730db7221678ee5f14b06abdccac1 Mon Sep 17 00:00:00 2001 From: RinCodeForge927 Date: Sat, 10 Jan 2026 20:35:21 +0700 Subject: [PATCH] tests: fix flaky TestUDPv5_lookupE2E by waiting for bootnode UDP port --- p2p/discover/v5_udp_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/p2p/discover/v5_udp_test.go b/p2p/discover/v5_udp_test.go index 6abe20d7a4..fec4d98991 100644 --- a/p2p/discover/v5_udp_test.go +++ b/p2p/discover/v5_udp_test.go @@ -49,6 +49,11 @@ func TestUDPv5_lookupE2E(t *testing.T) { var cfg Config if len(nodes) > 0 { bn := nodes[0].Self() + // Wait for bootnode to have a valid UDP port (fix for flaky test) + for j := 0; j < 50 && bn.UDP() == 0; j++ { + time.Sleep(10 * time.Millisecond) + bn = nodes[0].Self() + } cfg.Bootnodes = []*enode.Node{bn} } node := startLocalhostV5(t, cfg)