p2p/discover: wait for bootstrap to be done (#32881)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run

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:
Delweng 2025-10-14 01:58:50 +08:00 committed by GitHub
parent b28241ba85
commit 6337577434
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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