Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 9beae1e

Browse files
committed
fix: add timeout to avoid identify race condition
1 parent d3985a8 commit 9beae1e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/pubsub.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ module.exports = (common) => {
5555
return callback(err)
5656
}
5757

58+
console.log('->', peers)
5859
const hasAllPeers = peersToWait
5960
.map((e) => peers.includes(e))
6061
.filter((e) => e === false)
@@ -261,7 +262,10 @@ module.exports = (common) => {
261262
ipfs2.id((err, id) => {
262263
expect(err).to.not.exist
263264
const ipfs2Addr = id.addresses[0]
264-
ipfs1.swarm.connect(ipfs2Addr, done)
265+
ipfs1.swarm.connect(ipfs2Addr, (err) => {
266+
expect(err).to.not.exist
267+
setTimeout(done, 3000)
268+
})
265269
})
266270
})
267271

0 commit comments

Comments
 (0)