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

Commit

Permalink
fix bitswap timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed Dec 17, 2017
1 parent 06a9198 commit f9c66a0
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions test/cli/bitswap.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,39 @@
const expect = require('chai').expect
const runOn = require('../utils/on-and-off').on

describe('bitswap', function () {
runOn((thing) => {
this.timeout(30000)
let ipfs
const key = 'QmUBdnXXPyoDFXj3Hj39dNJ5VkN3QFRskXxcGaYFBB8CNR'
describe('bitswap', () => runOn((thing) => {
let ipfs
const key = 'QmUBdnXXPyoDFXj3Hj39dNJ5VkN3QFRskXxcGaYFBB8CNR'

before((done) => {
ipfs = thing.ipfs
ipfs('block get ' + key)
.then(() => {})
.catch(() => {})
setTimeout(done, 800)
})
before((done) => {
ipfs = thing.ipfs
ipfs('block get ' + key)
.then(() => {})
.catch(() => {})
setTimeout(done, 800)
})

it('wantlist', () => {
return ipfs('bitswap wantlist').then((out) => {
expect(out).to.eql(key + '\n')
})
it('wantlist', function () {
this.timeout(20 * 1000)
return ipfs('bitswap wantlist').then((out) => {
expect(out).to.eql(key + '\n')
})
})

it('stat', function () {
this.timeout(20 * 1000)

it('stat', () => {
return ipfs('bitswap stat').then((out) => {
expect(out).to.be.eql([
'bitswap status',
' blocks received: 0',
' dup blocks received: 0',
' dup data received: 0B',
' wantlist [1 keys]',
` ${key}`,
' partners [0]',
' '
].join('\n') + '\n')
})
return ipfs('bitswap stat').then((out) => {
expect(out).to.be.eql([
'bitswap status',
' blocks received: 0',
' dup blocks received: 0',
' dup data received: 0B',
' wantlist [1 keys]',
` ${key}`,
' partners [0]',
' '
].join('\n') + '\n')
})
})
})
}))

0 comments on commit f9c66a0

Please sign in to comment.