Skip to content

Commit

Permalink
Fix flakines in autorelay and basic_host
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoPolo committed Feb 15, 2023
1 parent 79d642f commit 87525e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion p2p/host/autorelay/autorelay_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func TestSingleCandidate(t *testing.T) {
)
defer h.Close()

require.Eventually(t, func() bool { return numRelays(h) > 0 }, 3*time.Second, 100*time.Millisecond)
require.Eventually(t, func() bool { return numRelays(h) > 0 }, 30*time.Second, 100*time.Millisecond)
// test that we don't add any more relays
require.Never(t, func() bool { return numRelays(h) > 1 }, 200*time.Millisecond, 50*time.Millisecond)
require.Equal(t, 1, counter, "expected the peer source callback to only have been called once")
Expand Down
2 changes: 1 addition & 1 deletion p2p/host/basic/basic_host_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ func getHostPair(t *testing.T) (host.Host, host.Host) {
require.NoError(t, err)
h2.Start()

ctx, cancel := context.WithTimeout(context.Background(), time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
h2pi := h2.Peerstore().PeerInfo(h2.ID())
require.NoError(t, h1.Connect(ctx, h2pi))
Expand Down

0 comments on commit 87525e8

Please sign in to comment.