Skip to content

Commit

Permalink
chore: fix flaky tests
Browse files Browse the repository at this point in the history
These tests are flaky in CI, probably due to differences in timing
introduced by #1058

Fixes #1134
  • Loading branch information
achingbrain committed Jan 21, 2022
1 parent a4bba35 commit adf9985
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/relay/auto-relay.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,9 @@ describe('auto-relay', () => {

// Wait for other peer connected to be added as listen addr
await pWaitFor(() => relayLibp2p1.transportManager.listen.callCount === 2)
expect(autoRelay1._tryToListenOnRelay.callCount).to.equal(1)
expect(autoRelay1._listenRelays.size).to.equal(1)
expect(relayLibp2p1.connectionManager.size).to.eql(1)
await pWaitFor(() => autoRelay1._tryToListenOnRelay.callCount === 1)
await pWaitFor(() => autoRelay1._listenRelays.size === 1)
await pWaitFor(() => relayLibp2p1.connectionManager.size === 1)
})

it('should not fail when trying to dial unreachable peers to add as hop relay and replaced removed ones', async () => {
Expand Down Expand Up @@ -492,7 +492,7 @@ describe('auto-relay', () => {

// Wait for peer added as listen relay
await pWaitFor(() => autoRelay2._addListenRelay.callCount === 1)
expect(autoRelay2._listenRelays.size).to.equal(1)
await pWaitFor(() => autoRelay2._listenRelays.size === 1)

// Relay 1 discovers Relay 2 relayed multiaddr via Relay 3
const ma2RelayedBy3 = relayLibp2p2.multiaddrs[relayLibp2p2.multiaddrs.length - 1]
Expand Down

0 comments on commit adf9985

Please sign in to comment.