Skip to content

Commit

Permalink
basichost: fix flaky TestSignedPeerRecordWithNoListenAddrs (#1559)
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann authored and MarcoPolo committed Jun 24, 2022
1 parent 3af7820 commit c4ef41f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion p2p/host/basic/basic_host_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit c4ef41f

Please sign in to comment.