mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-21 20:26:41 +00:00
tests: fix flaky TestUDPv5_lookupE2E by waiting for bootnode UDP port
This commit is contained in:
parent
84ff87cc65
commit
6769b383fb
1 changed files with 5 additions and 0 deletions
|
|
@ -49,6 +49,11 @@ func TestUDPv5_lookupE2E(t *testing.T) {
|
||||||
var cfg Config
|
var cfg Config
|
||||||
if len(nodes) > 0 {
|
if len(nodes) > 0 {
|
||||||
bn := nodes[0].Self()
|
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}
|
cfg.Bootnodes = []*enode.Node{bn}
|
||||||
}
|
}
|
||||||
node := startLocalhostV5(t, cfg)
|
node := startLocalhostV5(t, cfg)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue