mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 15:47:21 +00:00
p2p/discover: wait for bootstrap to be done (#32881)
This ensures the node is ready to accept other nodes into the table before it is used in a test. Closes #32863
This commit is contained in:
parent
b28241ba85
commit
6337577434
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