Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit f9c66a0

Browse files
committed
fix bitswap timeouts
1 parent 06a9198 commit f9c66a0

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

test/cli/bitswap.js

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,39 @@
44
const expect = require('chai').expect
55
const runOn = require('../utils/on-and-off').on
66

7-
describe('bitswap', function () {
8-
runOn((thing) => {
9-
this.timeout(30000)
10-
let ipfs
11-
const key = 'QmUBdnXXPyoDFXj3Hj39dNJ5VkN3QFRskXxcGaYFBB8CNR'
7+
describe('bitswap', () => runOn((thing) => {
8+
let ipfs
9+
const key = 'QmUBdnXXPyoDFXj3Hj39dNJ5VkN3QFRskXxcGaYFBB8CNR'
1210

13-
before((done) => {
14-
ipfs = thing.ipfs
15-
ipfs('block get ' + key)
16-
.then(() => {})
17-
.catch(() => {})
18-
setTimeout(done, 800)
19-
})
11+
before((done) => {
12+
ipfs = thing.ipfs
13+
ipfs('block get ' + key)
14+
.then(() => {})
15+
.catch(() => {})
16+
setTimeout(done, 800)
17+
})
2018

21-
it('wantlist', () => {
22-
return ipfs('bitswap wantlist').then((out) => {
23-
expect(out).to.eql(key + '\n')
24-
})
19+
it('wantlist', function () {
20+
this.timeout(20 * 1000)
21+
return ipfs('bitswap wantlist').then((out) => {
22+
expect(out).to.eql(key + '\n')
2523
})
24+
})
25+
26+
it('stat', function () {
27+
this.timeout(20 * 1000)
2628

27-
it('stat', () => {
28-
return ipfs('bitswap stat').then((out) => {
29-
expect(out).to.be.eql([
30-
'bitswap status',
31-
' blocks received: 0',
32-
' dup blocks received: 0',
33-
' dup data received: 0B',
34-
' wantlist [1 keys]',
35-
` ${key}`,
36-
' partners [0]',
37-
' '
38-
].join('\n') + '\n')
39-
})
29+
return ipfs('bitswap stat').then((out) => {
30+
expect(out).to.be.eql([
31+
'bitswap status',
32+
' blocks received: 0',
33+
' dup blocks received: 0',
34+
' dup data received: 0B',
35+
' wantlist [1 keys]',
36+
` ${key}`,
37+
' partners [0]',
38+
' '
39+
].join('\n') + '\n')
4040
})
4141
})
42-
})
42+
}))

0 commit comments

Comments
 (0)