mirror of
https://github.com/libp2p/go-libp2p.git
synced 2025-10-16 21:20:46 +08:00
basichost: fix flaky TestSignedPeerRecordWithNoListenAddrs (#1559)
This commit is contained in:
@@ -105,7 +105,15 @@ func TestSignedPeerRecordWithNoListenAddrs(t *testing.T) {
|
||||
t.Fatalf("peerstore doesn't support certified addrs")
|
||||
}
|
||||
// the signed record with the new addr is added async
|
||||
require.Eventually(t, func() bool { return cab.GetPeerRecord(h.ID()) != nil }, 100*time.Millisecond, 10*time.Millisecond)
|
||||
var env *record.Envelope
|
||||
require.Eventually(t, func() bool {
|
||||
env = cab.GetPeerRecord(h.ID())
|
||||
return env != nil
|
||||
}, 500*time.Millisecond, 10*time.Millisecond)
|
||||
rec, err := env.Record()
|
||||
require.NoError(t, err)
|
||||
require.NotEmpty(t, rec.(*peer.PeerRecord).Addrs)
|
||||
|
||||
}
|
||||
|
||||
func TestProtocolHandlerEvents(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user