mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 05:06:43 +00:00
fix(p2p/discover): wait for bootstrap to be done
This commit is contained in:
parent
659342a523
commit
965c141d2d
1 changed files with 7 additions and 0 deletions
|
|
@ -575,6 +575,13 @@ func startLocalhostV4(t *testing.T, cfg Config) *UDPv4 {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// Wait for bootstrap to complete.
|
||||
select {
|
||||
case <-udp.tab.initDone:
|
||||
case <-time.After(5 * time.Second):
|
||||
t.Fatalf("timed out waiting for table initialization")
|
||||
}
|
||||
return udp
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue