From f9c66a0387bacbce893bc9b3514a343854f3ec3b Mon Sep 17 00:00:00 2001 From: David Dias Date: Sun, 17 Dec 2017 21:45:47 +0000 Subject: [PATCH] fix bitswap timeouts --- test/cli/bitswap.js | 60 ++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/test/cli/bitswap.js b/test/cli/bitswap.js index 40e0ba3455..29220f7b71 100644 --- a/test/cli/bitswap.js +++ b/test/cli/bitswap.js @@ -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') }) }) -}) +}))