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

Commit 98d6b97

Browse files
author
Pedro Santos
committed
chore: increase wantlist timeout
1 parent 7873deb commit 98d6b97

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

src/bitswap/wantlist.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
const { getDescribe, getIt, expect } = require('../utils/mocha')
66
const { waitForWantlistKey } = require('./utils')
77

8+
const TIMEOUT = 120000
9+
810
module.exports = (createCommon, options) => {
911
const describe = getDescribe(options)
1012
const it = getIt(options)
@@ -21,26 +23,31 @@ module.exports = (createCommon, options) => {
2123
this.timeout(60 * 1000)
2224

2325
ipfsA = await common.setup()
24-
ipfsB = await common.setup()
26+
ipfsB = await common.setup({ factoryOptions: { type: 'go' } })
2527

2628
// Add key to the wantlist for ipfsB
27-
ipfsB.block.get(key, () => {})
29+
ipfsB.block.get(key).catch(() => {})
2830

2931
await ipfsA.swarm.connect(ipfsB.peerId.addresses[0])
3032
})
3133

3234
after(function () {
33-
this.timeout(30 * 1000)
35+
this.timeout(TIMEOUT)
3436

3537
return common.teardown()
3638
})
3739

38-
it('should get the wantlist', () => {
39-
return waitForWantlistKey(ipfsB, key)
40+
it('should get the wantlist', function () {
41+
this.timeout(TIMEOUT)
42+
return waitForWantlistKey(ipfsB, key, { timeout: TIMEOUT })
4043
})
4144

42-
it('should get the wantlist by peer ID for a diffreent node', () => {
43-
return waitForWantlistKey(ipfsA, key, { peerId: ipfsB.peerId.id })
45+
it('should get the wantlist by peer ID for a different node', function () {
46+
this.timeout(TIMEOUT)
47+
return waitForWantlistKey(ipfsA, key, {
48+
peerId: ipfsB.peerId.id,
49+
timeout: TIMEOUT
50+
})
4451
})
4552

4653
it('should not get the wantlist when offline', async function () {
@@ -49,7 +56,7 @@ module.exports = (createCommon, options) => {
4956
const node = await createCommon().setup()
5057
await node.stop()
5158

52-
return expect(node.bitswap.stat()).to.eventually.be.rejected()
59+
return expect(node.bitswap.wantlist()).to.eventually.be.rejected()
5360
})
5461
})
5562
}

0 commit comments

Comments
 (0)