tests: fix flaky TestUDPv5_lookupE2E by waiting for bootnode UDP port

This commit is contained in:
RinCodeForge927 2026-01-10 20:35:21 +07:00
parent 84ff87cc65
commit 6769b383fb

View file

@ -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)