diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2b9f0197f..0df5e5351 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## [0.124.1](https://github.com/ipfs/interface-ipfs-core/compare/v0.124.0...v0.124.1) (2019-12-10)
+
+
+
# [0.124.0](https://github.com/ipfs/interface-ipfs-core/compare/v0.123.0...v0.124.0) (2019-12-02)
diff --git a/package.json b/package.json
index ae1b83b24..a563b6b7c 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "interface-ipfs-core",
- "version": "0.124.0",
+ "version": "0.124.1",
"description": "A test suite and interface you can use to implement a IPFS core interface.",
"leadMaintainer": "Alan Shaw ",
"main": "src/index.js",
@@ -65,9 +65,8 @@
"p-map-series": "^2.1.0",
"p-timeout": "^3.2.0",
"p-times": "^2.1.0",
- "p-whilst": "^2.1.0",
- "peer-id": "~0.13.5",
- "peer-info": "~0.15.0",
+ "peer-id": "~0.12.2",
+ "peer-info": "~0.15.1",
"pull-stream": "^3.6.11",
"pull-to-promise": "^1.0.1",
"pump": "^3.0.0",
diff --git a/src/bitswap/stat.js b/src/bitswap/stat.js
index 30b5570f4..de99bc4a2 100644
--- a/src/bitswap/stat.js
+++ b/src/bitswap/stat.js
@@ -9,11 +9,14 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()
- describe('.bitswap.stat', function () {
- this.timeout(60 * 1000)
+ describe('.bitswap.stat', () => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
@@ -24,7 +27,9 @@ module.exports = (createCommon, options) => {
expectIsBitswap(null, res)
})
- it('should not get bitswap stats when offline', async () => {
+ it('should not get bitswap stats when offline', async function () {
+ this.timeout(60 * 1000)
+
const node = await createCommon().setup()
await node.stop()
diff --git a/src/bitswap/utils.js b/src/bitswap/utils.js
index d2b0cd11e..7e6ae646a 100644
--- a/src/bitswap/utils.js
+++ b/src/bitswap/utils.js
@@ -1,24 +1,22 @@
'use strict'
-const pWhilst = require('p-whilst')
+const delay = require('delay')
-function waitForWantlistKey (ipfs, key, opts = {}) {
+async function waitForWantlistKey (ipfs, key, opts = {}) {
opts.timeout = opts.timeout || 10000
+ const end = Date.now() + opts.timeout
- let list = { Keys: [] }
+ while (Date.now() < end) {
+ const list = await ipfs.bitswap.wantlist(opts.peerId)
- const start = Date.now()
- const findKey = () => !list.Keys.some(k => k['/'] === key)
-
- const iteratee = async () => {
- if (Date.now() - start > opts.timeout) {
- throw new Error(`Timed out waiting for ${key} in wantlist`)
+ if (list && list.Keys && list.Keys.some(k => k['/'] === key)) {
+ return
}
- list = await ipfs.bitswap.wantlist(opts.peerId)
+ await delay(500)
}
- return pWhilst(findKey, iteratee)
+ throw new Error(`Timed out waiting for ${key} in wantlist`)
}
module.exports.waitForWantlistKey = waitForWantlistKey
diff --git a/src/bitswap/wantlist.js b/src/bitswap/wantlist.js
index 34480a900..63ca125d7 100644
--- a/src/bitswap/wantlist.js
+++ b/src/bitswap/wantlist.js
@@ -1,5 +1,4 @@
/* eslint-env mocha */
-/* eslint max-nested-callbacks: ["error", 6] */
'use strict'
const { getDescribe, getIt, expect } = require('../utils/mocha')
@@ -10,37 +9,51 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()
- describe('.bitswap.wantlist', function () {
- this.timeout(60 * 1000)
+ describe('.bitswap.wantlist', () => {
let ipfsA
let ipfsB
const key = 'QmUBdnXXPyoDFXj3Hj39dNJ5VkN3QFRskXxcGaYFBB8CNR'
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfsA = await common.setup()
ipfsB = await common.setup()
// Add key to the wantlist for ipfsB
- ipfsB.block.get(key, () => {})
+ ipfsB.block.get(key).catch(() => {})
await ipfsA.swarm.connect(ipfsB.peerId.addresses[0])
})
- after(() => common.teardown())
+ after(function () {
+ this.timeout(30 * 1000)
+
+ return common.teardown()
+ })
- it('should get the wantlist', () => {
+ it('should get the wantlist', function () {
+ this.timeout(60 * 1000)
return waitForWantlistKey(ipfsB, key)
})
- it('should get the wantlist by peer ID for a diffreent node', () => {
- return waitForWantlistKey(ipfsA, key, { peerId: ipfsB.peerId.id })
+ it('should get the wantlist by peer ID for a different node', function () {
+ this.timeout(60 * 1000)
+ return waitForWantlistKey(ipfsA, key, {
+ peerId: ipfsB.peerId.id,
+ timeout: 60 * 1000
+ })
})
- it('should not get the wantlist when offline', async () => {
+ it('should not get the wantlist when offline', async function () {
+ this.timeout(60 * 1000)
+
const node = await createCommon().setup()
await node.stop()
- return expect(node.bitswap.stat()).to.eventually.be.rejected()
+ return expect(node.bitswap.wantlist()).to.eventually.be.rejected()
})
})
}
diff --git a/src/block/get.js b/src/block/get.js
index 38e2a659a..e07e68d5d 100644
--- a/src/block/get.js
+++ b/src/block/get.js
@@ -10,12 +10,15 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()
- describe('.block.get', function () {
- this.timeout(60 * 1000)
+ describe('.block.get', () => {
const data = Buffer.from('blorb')
let ipfs, hash
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
const block = await ipfs.block.put(data)
hash = block.cid.multihash
diff --git a/src/block/put.js b/src/block/put.js
index 1df2edc99..ec8d3ffb1 100644
--- a/src/block/put.js
+++ b/src/block/put.js
@@ -11,11 +11,14 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()
- describe('.block.put', function () {
- this.timeout(60 * 1000)
+ describe('.block.put', () => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/block/rm.js b/src/block/rm.js
index 8f99fa23a..e5fe1fe0e 100644
--- a/src/block/rm.js
+++ b/src/block/rm.js
@@ -9,11 +9,14 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()
- describe('.block.rm', function () {
- this.timeout(60 * 1000)
+ describe('.block.rm', () => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/block/stat.js b/src/block/stat.js
index 0d1a5976e..baa7a66ff 100644
--- a/src/block/stat.js
+++ b/src/block/stat.js
@@ -9,12 +9,15 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()
- describe('.block.stat', function () {
- this.timeout(60 * 1000)
+ describe('.block.stat', () => {
const data = Buffer.from('blorb')
let ipfs, hash
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
const block = await ipfs.block.put(data)
hash = block.cid.multihash
diff --git a/src/bootstrap/add.js b/src/bootstrap/add.js
index eb8034663..c4a8440d6 100644
--- a/src/bootstrap/add.js
+++ b/src/bootstrap/add.js
@@ -16,7 +16,11 @@ module.exports = (createCommon, options) => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/bootstrap/list.js b/src/bootstrap/list.js
index ffb75c23d..033920571 100644
--- a/src/bootstrap/list.js
+++ b/src/bootstrap/list.js
@@ -13,7 +13,11 @@ module.exports = (createCommon, options) => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/bootstrap/rm.js b/src/bootstrap/rm.js
index 172cf014d..f8e200402 100644
--- a/src/bootstrap/rm.js
+++ b/src/bootstrap/rm.js
@@ -16,7 +16,11 @@ module.exports = (createCommon, options) => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/config/get.js b/src/config/get.js
index 199257e36..9470c1b67 100644
--- a/src/config/get.js
+++ b/src/config/get.js
@@ -10,10 +10,14 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.config.get', function () {
- this.timeout(60 * 1000)
+ this.timeout(30 * 1000)
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/config/profiles/apply.js b/src/config/profiles/apply.js
index 7cd96f785..ca0b91262 100644
--- a/src/config/profiles/apply.js
+++ b/src/config/profiles/apply.js
@@ -12,7 +12,11 @@ module.exports = (createCommon, options) => {
this.timeout(30 * 1000)
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/config/profiles/list.js b/src/config/profiles/list.js
index 69482b21b..ffe572388 100644
--- a/src/config/profiles/list.js
+++ b/src/config/profiles/list.js
@@ -9,10 +9,14 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.config.profiles.list', function () {
- this.timeout(60 * 1000)
+ this.timeout(30 * 1000)
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/config/replace.js b/src/config/replace.js
index bab2133cc..67496a7d7 100644
--- a/src/config/replace.js
+++ b/src/config/replace.js
@@ -9,10 +9,14 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.config.replace', function () {
- this.timeout(60 * 1000)
+ this.timeout(30 * 1000)
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/config/set.js b/src/config/set.js
index c808c4ec2..1e29d9234 100644
--- a/src/config/set.js
+++ b/src/config/set.js
@@ -9,10 +9,14 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.config.set', function () {
- this.timeout(60 * 1000)
+ this.timeout(30 * 1000)
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/dag/get.js b/src/dag/get.js
index ad68e2794..dc8ee9ee9 100644
--- a/src/dag/get.js
+++ b/src/dag/get.js
@@ -14,11 +14,16 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()
- describe('.dag.get', function () {
- this.timeout(60 * 1000)
+ describe('.dag.get', () => {
let ipfs
- before(async () => { ipfs = await common.setup() })
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
+ ipfs = await common.setup()
+ })
after(() => common.teardown())
diff --git a/src/dag/put.js b/src/dag/put.js
index 9ef382c98..eb52106cb 100644
--- a/src/dag/put.js
+++ b/src/dag/put.js
@@ -13,11 +13,16 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()
- describe('.dag.put', function () {
- this.timeout(60 * 1000)
+ describe('.dag.put', () => {
let ipfs
- before(async () => { ipfs = await common.setup() })
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
+ ipfs = await common.setup()
+ })
after(() => common.teardown())
diff --git a/src/dag/tree.js b/src/dag/tree.js
index a60746f7e..fe9826209 100644
--- a/src/dag/tree.js
+++ b/src/dag/tree.js
@@ -12,11 +12,16 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()
- describe('.dag.tree', function () {
- this.timeout(60 * 1000)
+ describe('.dag.tree', () => {
let ipfs
- before(async () => { ipfs = await common.setup() })
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
+ ipfs = await common.setup()
+ })
after(() => common.teardown())
diff --git a/src/dht/find-peer.js b/src/dht/find-peer.js
index 898ddf4b7..5c6c3b4e4 100644
--- a/src/dht/find-peer.js
+++ b/src/dht/find-peer.js
@@ -14,13 +14,21 @@ module.exports = (createCommon, options) => {
let nodeA
let nodeB
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
nodeA = await common.setup()
nodeB = await common.setup()
await nodeB.swarm.connect(nodeA.peerId.addresses[0])
})
- after(() => common.teardown())
+ after(function () {
+ this.timeout(50 * 1000)
+
+ return common.teardown()
+ })
it('should find other peers', async () => {
const res = await nodeA.dht.findPeer(nodeB.peerId.id)
diff --git a/src/dht/find-provs.js b/src/dht/find-provs.js
index 4897f4f16..9e3016666 100644
--- a/src/dht/find-provs.js
+++ b/src/dht/find-provs.js
@@ -18,15 +18,16 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()
- describe('.dht.findProvs', function () {
- this.timeout(80 * 1000)
-
+ describe('.dht.findProvs', () => {
let nodeA
let nodeB
let nodeC
before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
this.timeout(60 * 1000)
+
nodeA = await common.setup()
nodeB = await common.setup()
nodeC = await common.setup()
@@ -36,7 +37,11 @@ module.exports = (createCommon, options) => {
])
})
- after(() => common.teardown())
+ after(function () {
+ this.timeout(50 * 1000)
+
+ return common.teardown()
+ })
let providedCid
before('add providers for the same cid', async function () {
@@ -56,6 +61,8 @@ module.exports = (createCommon, options) => {
})
it('should be able to find providers', async function () {
+ this.timeout(20 * 1000)
+
const provs = await nodeA.dht.findProvs(providedCid)
const providerIds = provs.map((p) => p.id.toB58String())
diff --git a/src/dht/get.js b/src/dht/get.js
index a71e54d22..0fe6df9e4 100644
--- a/src/dht/get.js
+++ b/src/dht/get.js
@@ -15,20 +15,30 @@ module.exports = (createCommon, options) => {
let nodeA
let nodeB
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
nodeA = await common.setup()
nodeB = await common.setup()
await nodeA.swarm.connect(nodeB.peerId.addresses[0])
})
- after(() => common.teardown())
+ after(function () {
+ this.timeout(50 * 1000)
+
+ return common.teardown()
+ })
it('should error when getting a non-existent key from the DHT', () => {
return expect(nodeA.dht.get('non-existing', { timeout: 100 })).to.eventually.be.rejected
.and.be.an.instanceOf(Error)
})
- it('should get a value after it was put on another node', async () => {
+ it('should get a value after it was put on another node', async function () {
+ this.timeout(80 * 1000)
+
const key = Buffer.from(hat())
const value = Buffer.from(hat())
diff --git a/src/dht/provide.js b/src/dht/provide.js
index 456dcbc7d..c4c6fafd6 100644
--- a/src/dht/provide.js
+++ b/src/dht/provide.js
@@ -14,13 +14,21 @@ module.exports = (createCommon, options) => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
const nodeB = await common.setup()
await ipfs.swarm.connect(nodeB.peerId.addresses[0])
})
- after(() => common.teardown())
+ after(function () {
+ this.timeout(50 * 1000)
+
+ return common.teardown()
+ })
it('should provide local CID', async () => {
const res = await ipfs.add(Buffer.from('test'))
diff --git a/src/dht/put.js b/src/dht/put.js
index 826c9fcce..04a795c5a 100644
--- a/src/dht/put.js
+++ b/src/dht/put.js
@@ -14,7 +14,11 @@ module.exports = (createCommon, options) => {
let nodeA
let nodeB
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
nodeA = await common.setup()
nodeB = await common.setup()
await nodeA.swarm.connect(nodeB.peerId.addresses[0])
@@ -22,7 +26,9 @@ module.exports = (createCommon, options) => {
after(() => common.teardown())
- it('should put a value to the DHT', async () => {
+ it('should put a value to the DHT', async function () {
+ this.timeout(80 * 1000)
+
const key = Buffer.from('QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn')
const data = Buffer.from('data')
diff --git a/src/dht/query.js b/src/dht/query.js
index 2e155911f..015147d48 100644
--- a/src/dht/query.js
+++ b/src/dht/query.js
@@ -15,13 +15,21 @@ module.exports = (createCommon, options) => {
let nodeA
let nodeB
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
nodeA = await common.setup()
nodeB = await common.setup()
await nodeB.swarm.connect(nodeA.peerId.addresses[0])
})
- after(() => common.teardown())
+ after(function () {
+ this.timeout(50 * 1000)
+
+ return common.teardown()
+ })
it('should return the other node in the query', async function () {
const timeout = 150 * 1000
diff --git a/src/files-mfs/cp.js b/src/files-mfs/cp.js
index 966a8c302..400fe88ab 100644
--- a/src/files-mfs/cp.js
+++ b/src/files-mfs/cp.js
@@ -11,11 +11,17 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.files.cp', function () {
- this.timeout(60 * 1000)
+ this.timeout(40 * 1000)
let ipfs
- before(async () => { ipfs = await common.setup() })
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
+ ipfs = await common.setup()
+ })
after(() => common.teardown())
diff --git a/src/files-mfs/flush.js b/src/files-mfs/flush.js
index eb3b66df3..fb53808ce 100644
--- a/src/files-mfs/flush.js
+++ b/src/files-mfs/flush.js
@@ -10,11 +10,17 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.files.flush', function () {
- this.timeout(60 * 1000)
+ this.timeout(40 * 1000)
let ipfs
- before(async () => { ipfs = await common.setup() })
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
+ ipfs = await common.setup()
+ })
after(() => common.teardown())
diff --git a/src/files-mfs/ls-pull-stream.js b/src/files-mfs/ls-pull-stream.js
index 6210eaed6..72f6563f7 100644
--- a/src/files-mfs/ls-pull-stream.js
+++ b/src/files-mfs/ls-pull-stream.js
@@ -11,11 +11,17 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.files.lsPullStream', function () {
- this.timeout(60 * 1000)
+ this.timeout(40 * 1000)
let ipfs
- before(async () => { ipfs = await common.setup() })
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
+ ipfs = await common.setup()
+ })
after(() => common.teardown())
diff --git a/src/files-mfs/ls-readable-stream.js b/src/files-mfs/ls-readable-stream.js
index e3a11a827..c32cfd709 100644
--- a/src/files-mfs/ls-readable-stream.js
+++ b/src/files-mfs/ls-readable-stream.js
@@ -11,11 +11,17 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.files.lsReadableStream', function () {
- this.timeout(60 * 1000)
+ this.timeout(40 * 1000)
let ipfs
- before(async () => { ipfs = await common.setup() })
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
+ ipfs = await common.setup()
+ })
after(() => common.teardown())
diff --git a/src/files-mfs/ls.js b/src/files-mfs/ls.js
index 600db8d5a..0cf36c661 100644
--- a/src/files-mfs/ls.js
+++ b/src/files-mfs/ls.js
@@ -11,11 +11,17 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.files.ls', function () {
- this.timeout(60 * 1000)
+ this.timeout(40 * 1000)
let ipfs
- before(async () => { ipfs = await common.setup() })
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
+ ipfs = await common.setup()
+ })
after(() => common.teardown())
diff --git a/src/files-mfs/mkdir.js b/src/files-mfs/mkdir.js
index 9cc0dd5da..4c2baf6b3 100644
--- a/src/files-mfs/mkdir.js
+++ b/src/files-mfs/mkdir.js
@@ -10,11 +10,17 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.files.mkdir', function () {
- this.timeout(60 * 1000)
+ this.timeout(40 * 1000)
let ipfs
- before(async () => { ipfs = await common.setup() })
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
+ ipfs = await common.setup()
+ })
after(() => common.teardown())
diff --git a/src/files-mfs/mv.js b/src/files-mfs/mv.js
index 7cdbeaf05..fa54d598e 100644
--- a/src/files-mfs/mv.js
+++ b/src/files-mfs/mv.js
@@ -10,11 +10,17 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.files.mv', function () {
- this.timeout(60 * 1000)
+ this.timeout(40 * 1000)
let ipfs
- before(async () => { ipfs = await common.setup() })
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
+ ipfs = await common.setup()
+ })
before(async () => {
await ipfs.files.mkdir('/test/lv1/lv2', { parents: true })
diff --git a/src/files-mfs/read-pull-stream.js b/src/files-mfs/read-pull-stream.js
index 6b70a494f..45b9af8dc 100644
--- a/src/files-mfs/read-pull-stream.js
+++ b/src/files-mfs/read-pull-stream.js
@@ -11,11 +11,17 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.files.readPullStream', function () {
- this.timeout(60 * 1000)
+ this.timeout(40 * 1000)
let ipfs
- before(async () => { ipfs = await common.setup() })
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
+ ipfs = await common.setup()
+ })
after(() => common.teardown())
diff --git a/src/files-mfs/read-readable-stream.js b/src/files-mfs/read-readable-stream.js
index c6f286652..d8344ee17 100644
--- a/src/files-mfs/read-readable-stream.js
+++ b/src/files-mfs/read-readable-stream.js
@@ -11,11 +11,17 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.files.readReadableStream', function () {
- this.timeout(60 * 1000)
+ this.timeout(40 * 1000)
let ipfs
- before(async () => { ipfs = await common.setup() })
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
+ ipfs = await common.setup()
+ })
after(() => common.teardown())
diff --git a/src/files-mfs/read.js b/src/files-mfs/read.js
index 6b97d91c5..91c6e533b 100644
--- a/src/files-mfs/read.js
+++ b/src/files-mfs/read.js
@@ -11,11 +11,17 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.files.read', function () {
- this.timeout(60 * 1000)
+ this.timeout(40 * 1000)
let ipfs
- before(async () => { ipfs = await common.setup() })
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
+ ipfs = await common.setup()
+ })
after(() => common.teardown())
diff --git a/src/files-mfs/rm.js b/src/files-mfs/rm.js
index a8412ea98..9d13ca06b 100644
--- a/src/files-mfs/rm.js
+++ b/src/files-mfs/rm.js
@@ -10,11 +10,17 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.files.rm', function () {
- this.timeout(60 * 1000)
+ this.timeout(40 * 1000)
let ipfs
- before(async () => { ipfs = await common.setup() })
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
+ ipfs = await common.setup()
+ })
after(() => common.teardown())
diff --git a/src/files-mfs/stat.js b/src/files-mfs/stat.js
index 9bc3ccb7b..b0619ea16 100644
--- a/src/files-mfs/stat.js
+++ b/src/files-mfs/stat.js
@@ -11,11 +11,17 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.files.stat', function () {
- this.timeout(60 * 1000)
+ this.timeout(40 * 1000)
let ipfs
- before(async () => { ipfs = await common.setup() })
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
+ ipfs = await common.setup()
+ })
before(async () => { await ipfs.add(fixtures.smallFile.data) })
after(() => common.teardown())
diff --git a/src/files-mfs/write.js b/src/files-mfs/write.js
index 6fc3e42d1..f81a1a36b 100644
--- a/src/files-mfs/write.js
+++ b/src/files-mfs/write.js
@@ -14,7 +14,13 @@ module.exports = (createCommon, options) => {
let ipfs
- before(async () => { ipfs = await common.setup() })
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
+ ipfs = await common.setup()
+ })
after(() => common.teardown())
diff --git a/src/files-regular/add-from-fs.js b/src/files-regular/add-from-fs.js
index 5a0765e9b..dc5f892df 100644
--- a/src/files-regular/add-from-fs.js
+++ b/src/files-regular/add-from-fs.js
@@ -13,12 +13,18 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.addFromFs', function () {
- this.timeout(60 * 1000)
+ this.timeout(40 * 1000)
const fixturesPath = path.join(__dirname, '../../test/fixtures')
let ipfs
- before(async () => { ipfs = await common.setup() })
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
+ ipfs = await common.setup()
+ })
after(() => common.teardown())
diff --git a/src/files-regular/add-from-stream.js b/src/files-regular/add-from-stream.js
index 34ee1c3c7..9df66ee37 100644
--- a/src/files-regular/add-from-stream.js
+++ b/src/files-regular/add-from-stream.js
@@ -11,11 +11,17 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.addFromStream', function () {
- this.timeout(60 * 1000)
+ this.timeout(40 * 1000)
let ipfs
- before(async () => { ipfs = await common.setup() })
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
+ ipfs = await common.setup()
+ })
after(() => common.teardown())
diff --git a/src/files-regular/add-from-url.js b/src/files-regular/add-from-url.js
index c57fc7e4f..d1e68baaa 100644
--- a/src/files-regular/add-from-url.js
+++ b/src/files-regular/add-from-url.js
@@ -11,11 +11,17 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.addFromURL', function () {
- this.timeout(60 * 1000)
+ this.timeout(40 * 1000)
let ipfs
- before(async () => { ipfs = await common.setup() })
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
+ ipfs = await common.setup()
+ })
after(() => common.teardown())
diff --git a/src/files-regular/add-pull-stream.js b/src/files-regular/add-pull-stream.js
index 9dd753842..9606e2491 100644
--- a/src/files-regular/add-pull-stream.js
+++ b/src/files-regular/add-pull-stream.js
@@ -12,11 +12,17 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.addPullStream', function () {
- this.timeout(60 * 1000)
+ this.timeout(40 * 1000)
let ipfs
- before(async () => { ipfs = await common.setup() })
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
+ ipfs = await common.setup()
+ })
after(() => common.teardown())
diff --git a/src/files-regular/add-readable-stream.js b/src/files-regular/add-readable-stream.js
index 749ac1e7f..6b5d33eae 100644
--- a/src/files-regular/add-readable-stream.js
+++ b/src/files-regular/add-readable-stream.js
@@ -11,11 +11,17 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.addReadableStream', function () {
- this.timeout(60 * 1000)
+ this.timeout(40 * 1000)
let ipfs
- before(async () => { ipfs = await common.setup() })
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
+ ipfs = await common.setup()
+ })
after(() => common.teardown())
diff --git a/src/files-regular/add.js b/src/files-regular/add.js
index fdea60e4b..9faa37752 100644
--- a/src/files-regular/add.js
+++ b/src/files-regular/add.js
@@ -18,7 +18,13 @@ module.exports = (createCommon, options) => {
let ipfs
- before(async () => { ipfs = await common.setup() })
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
+ ipfs = await common.setup()
+ })
after(() => common.teardown())
diff --git a/src/files-regular/cat-pull-stream.js b/src/files-regular/cat-pull-stream.js
index 28aa765e9..18842d13e 100644
--- a/src/files-regular/cat-pull-stream.js
+++ b/src/files-regular/cat-pull-stream.js
@@ -11,11 +11,17 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.catPullStream', function () {
- this.timeout(60 * 1000)
+ this.timeout(40 * 1000)
let ipfs
- before(async () => { ipfs = await common.setup() })
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
+ ipfs = await common.setup()
+ })
before(() => ipfs.add(fixtures.smallFile.data))
after(() => common.teardown())
diff --git a/src/files-regular/cat-readable-stream.js b/src/files-regular/cat-readable-stream.js
index 16f3e98db..17778b664 100644
--- a/src/files-regular/cat-readable-stream.js
+++ b/src/files-regular/cat-readable-stream.js
@@ -11,11 +11,15 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.catReadableStream', function () {
- this.timeout(60 * 1000)
+ this.timeout(40 * 1000)
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
await ipfs.add(fixtures.bigFile.data)
await ipfs.add(fixtures.smallFile.data)
diff --git a/src/files-regular/cat.js b/src/files-regular/cat.js
index 2681e689a..41523adf2 100644
--- a/src/files-regular/cat.js
+++ b/src/files-regular/cat.js
@@ -12,11 +12,17 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.cat', function () {
- this.timeout(60 * 1000)
+ this.timeout(40 * 1000)
let ipfs
- before(async () => { ipfs = await common.setup() })
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
+ ipfs = await common.setup()
+ })
after(() => common.teardown())
diff --git a/src/files-regular/get-pull-stream.js b/src/files-regular/get-pull-stream.js
index 03f9c379b..ee50075e7 100644
--- a/src/files-regular/get-pull-stream.js
+++ b/src/files-regular/get-pull-stream.js
@@ -11,11 +11,17 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.getPullStream', function () {
- this.timeout(60 * 1000)
+ this.timeout(40 * 1000)
let ipfs
- before(async () => { ipfs = await common.setup() })
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
+ ipfs = await common.setup()
+ })
before(() => ipfs.add(fixtures.smallFile.data))
diff --git a/src/files-regular/get-readable-stream.js b/src/files-regular/get-readable-stream.js
index e82442479..ed1837bb6 100644
--- a/src/files-regular/get-readable-stream.js
+++ b/src/files-regular/get-readable-stream.js
@@ -12,11 +12,15 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.getReadableStream', function () {
- this.timeout(60 * 1000)
+ this.timeout(40 * 1000)
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
await ipfs.add(fixtures.smallFile.data)
})
diff --git a/src/files-regular/get.js b/src/files-regular/get.js
index 2bfe5d690..8a940f2ba 100644
--- a/src/files-regular/get.js
+++ b/src/files-regular/get.js
@@ -12,11 +12,15 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.get', function () {
- this.timeout(60 * 1000)
+ this.timeout(40 * 1000)
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
await ipfs.add(fixtures.smallFile.data)
await ipfs.add(fixtures.bigFile.data)
diff --git a/src/files-regular/ls-pull-stream.js b/src/files-regular/ls-pull-stream.js
index 963b2da1e..8b9ff1739 100644
--- a/src/files-regular/ls-pull-stream.js
+++ b/src/files-regular/ls-pull-stream.js
@@ -11,11 +11,15 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.lsPullStream', function () {
- this.timeout(60 * 1000)
+ this.timeout(40 * 1000)
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/files-regular/ls-readable-stream.js b/src/files-regular/ls-readable-stream.js
index f3d0cbbca..ccf27dc65 100644
--- a/src/files-regular/ls-readable-stream.js
+++ b/src/files-regular/ls-readable-stream.js
@@ -11,11 +11,15 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.lsReadableStream', function () {
- this.timeout(60 * 1000)
+ this.timeout(40 * 1000)
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/files-regular/ls.js b/src/files-regular/ls.js
index 3dc3b73e0..6e32e6bc0 100644
--- a/src/files-regular/ls.js
+++ b/src/files-regular/ls.js
@@ -1,5 +1,4 @@
/* eslint-env mocha */
-/* eslint max-nested-callbacks: ["error", 6] */
'use strict'
const { fixtures } = require('./utils')
@@ -14,11 +13,15 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.ls', function () {
- this.timeout(60 * 1000)
+ this.timeout(40 * 1000)
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/files-regular/refs-local-tests.js b/src/files-regular/refs-local-tests.js
index 78c8e6702..6d5cda042 100644
--- a/src/files-regular/refs-local-tests.js
+++ b/src/files-regular/refs-local-tests.js
@@ -10,11 +10,15 @@ module.exports = (createCommon, suiteName, ipfsRefsLocal, options) => {
const common = createCommon()
describe(suiteName, function () {
- this.timeout(60 * 1000)
+ this.timeout(40 * 1000)
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/files-regular/refs-tests.js b/src/files-regular/refs-tests.js
index 60bdebc4d..3725800d8 100644
--- a/src/files-regular/refs-tests.js
+++ b/src/files-regular/refs-tests.js
@@ -13,11 +13,15 @@ module.exports = (createCommon, suiteName, ipfsRefs, options) => {
const common = createCommon()
describe(suiteName, function () {
- this.timeout(60 * 1000)
+ this.timeout(40 * 1000)
let ipfs, pbRootCb, dagRootCid
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/key/export.js b/src/key/export.js
index ddfb783b9..70d1588fa 100644
--- a/src/key/export.js
+++ b/src/key/export.js
@@ -9,11 +9,14 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()
- describe('.key.export', function () {
- this.timeout(60 * 1000)
+ describe('.key.export', () => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/key/gen.js b/src/key/gen.js
index 71d5be51e..726cfdb03 100644
--- a/src/key/gen.js
+++ b/src/key/gen.js
@@ -9,15 +9,18 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()
- describe('.key.gen', function () {
- this.timeout(60 * 1000)
+ describe('.key.gen', () => {
const keyTypes = [
{ type: 'rsa', size: 2048 }
]
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/key/import.js b/src/key/import.js
index 8669223cd..4ed73ba36 100644
--- a/src/key/import.js
+++ b/src/key/import.js
@@ -9,11 +9,14 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()
- describe('.key.import', function () {
- this.timeout(60 * 1000)
+ describe('.key.import', () => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/key/list.js b/src/key/list.js
index 383989435..b8b1af780 100644
--- a/src/key/list.js
+++ b/src/key/list.js
@@ -1,5 +1,4 @@
/* eslint-env mocha */
-/* eslint max-nested-callbacks: ["error", 6] */
'use strict'
const pTimes = require('p-times')
@@ -11,17 +10,22 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()
- describe('.key.list', function () {
- this.timeout(60 * 1000)
+ describe('.key.list', () => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
after(() => common.teardown())
it('should list all the keys', async function () {
+ this.timeout(60 * 1000)
+
const keys = await pTimes(3, () => ipfs.key.gen(hat(), { type: 'rsa', size: 2048 }), { concurrency: 1 })
const res = await ipfs.key.list()
diff --git a/src/key/rename.js b/src/key/rename.js
index a18796059..a3f5333cc 100644
--- a/src/key/rename.js
+++ b/src/key/rename.js
@@ -1,5 +1,4 @@
/* eslint-env mocha */
-/* eslint max-nested-callbacks: ["error", 6] */
'use strict'
const hat = require('hat')
@@ -10,17 +9,22 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()
- describe('.key.rename', function () {
- this.timeout(60 * 1000)
+ describe('.key.rename', () => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
after(() => common.teardown())
it('should rename a key', async function () {
+ this.timeout(30 * 1000)
+
const oldName = hat()
const newName = hat()
diff --git a/src/key/rm.js b/src/key/rm.js
index 5140ed901..3607b93a4 100644
--- a/src/key/rm.js
+++ b/src/key/rm.js
@@ -1,5 +1,4 @@
/* eslint-env mocha */
-/* eslint max-nested-callbacks: ["error", 6] */
'use strict'
const hat = require('hat')
@@ -10,17 +9,22 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()
- describe('.key.rm', function () {
- this.timeout(60 * 1000)
+ describe('.key.rm', () => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
after(() => common.teardown())
it('should rm a key', async function () {
+ this.timeout(30 * 1000)
+
const key = await ipfs.key.gen(hat(), { type: 'rsa', size: 2048 })
const removeRes = await ipfs.key.rm(key.name)
diff --git a/src/miscellaneous/dns.js b/src/miscellaneous/dns.js
index 490c04db0..9a68ea808 100644
--- a/src/miscellaneous/dns.js
+++ b/src/miscellaneous/dns.js
@@ -13,7 +13,11 @@ module.exports = (createCommon, options) => {
this.retries(3)
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/miscellaneous/resolve.js b/src/miscellaneous/resolve.js
index 699c122b8..6eb65819d 100644
--- a/src/miscellaneous/resolve.js
+++ b/src/miscellaneous/resolve.js
@@ -1,5 +1,4 @@
/* eslint-env mocha */
-/* eslint max-nested-callbacks: ["error", 5] */
'use strict'
const isIpfs = require('is-ipfs')
@@ -77,8 +76,16 @@ module.exports = (createCommon, options) => {
})
it('should resolve IPNS link recursively', async function () {
- const node = await common.setup()
- await ipfs.swarm.connect(node.peerId.addresses.find((a) => a.includes('127.0.0.1')))
+ this.timeout(20 * 1000)
+
+ // Ensure another node exists for publishing to - only required by go-ipfs
+ if (ipfs.peerId.agentVersion.includes('go-ipfs')) {
+ const node = await common.setup()
+
+ // this fails in the browser because there is no relay node available to connect the two
+ // nodes, but we only need this for go-ipfs as it doesn't support the `allowOffline` flag yet
+ await ipfs.swarm.connect(node.peerId.addresses.find((a) => a.includes('127.0.0.1')))
+ }
const [{ path }] = await ipfs.add(Buffer.from('should resolve a record recursive === true'))
const { id: keyId } = await ipfs.key.gen('key-name', { type: 'rsa', size: 2048 })
diff --git a/src/miscellaneous/stop.js b/src/miscellaneous/stop.js
index d83fdc9e3..58ee8bea6 100644
--- a/src/miscellaneous/stop.js
+++ b/src/miscellaneous/stop.js
@@ -8,12 +8,10 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()
- describe('.stop', function () {
- this.timeout(60 * 1000)
-
+ describe('.stop', () => {
it('should stop the node', async function () {
- const ipfs = await common.setup()
this.timeout(10 * 1000)
+ const ipfs = await common.setup()
await ipfs.stop()
diff --git a/src/miscellaneous/version.js b/src/miscellaneous/version.js
index 1d8f58eb8..c38af691b 100644
--- a/src/miscellaneous/version.js
+++ b/src/miscellaneous/version.js
@@ -8,11 +8,14 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()
- describe('.version', function () {
- this.timeout(60 * 1000)
+ describe('.version', () => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/name-pubsub/cancel.js b/src/name-pubsub/cancel.js
index cf2a30d0e..2a887ca17 100644
--- a/src/name-pubsub/cancel.js
+++ b/src/name-pubsub/cancel.js
@@ -1,8 +1,8 @@
-/* eslint max-nested-callbacks: ["error", 5] */
/* eslint-env mocha */
'use strict'
const PeerId = require('peer-id')
+const { promisify } = require('es6-promisify')
const { getDescribe, getIt, expect } = require('../utils/mocha')
@@ -11,11 +11,15 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()
- describe('.name.pubsub.cancel', function () {
+ describe('.name.pubsub.cancel', () => {
let ipfs
let nodeId
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
nodeId = ipfs.peerId.id
})
@@ -34,8 +38,7 @@ module.exports = (createCommon, options) => {
it('should cancel a subscription correctly returning true', async function () {
this.timeout(300 * 1000)
- const peerId = await PeerId.create({ bits: 512 })
-
+ const peerId = await promisify(PeerId.create.bind(PeerId))({ bits: 512 })
const id = peerId.toB58String()
const ipnsPath = `/ipns/${id}`
diff --git a/src/name-pubsub/state.js b/src/name-pubsub/state.js
index df40c7b20..13ec1e08e 100644
--- a/src/name-pubsub/state.js
+++ b/src/name-pubsub/state.js
@@ -8,11 +8,14 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()
- describe('.name.pubsub.state', function () {
- this.timeout(60 * 1000)
+ describe('.name.pubsub.state', () => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/name-pubsub/subs.js b/src/name-pubsub/subs.js
index 388d650dd..1d3e2dd07 100644
--- a/src/name-pubsub/subs.js
+++ b/src/name-pubsub/subs.js
@@ -1,4 +1,3 @@
-/* eslint max-nested-callbacks: ["error", 5] */
/* eslint-env mocha */
'use strict'
@@ -9,10 +8,14 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()
- describe('.name.pubsub.subs', function () {
+ describe('.name.pubsub.subs', () => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/name/publish.js b/src/name/publish.js
index b21315ea7..7c4733db1 100644
--- a/src/name/publish.js
+++ b/src/name/publish.js
@@ -11,12 +11,16 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()
- describe('.name.publish offline', function () {
+ describe('.name.publish offline', () => {
const keyName = hat()
let ipfs
let nodeId
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
nodeId = ipfs.peerId.id
await ipfs.add(fixture.data, { pin: false })
diff --git a/src/name/resolve.js b/src/name/resolve.js
index 1f72a0c05..94ff8249f 100644
--- a/src/name/resolve.js
+++ b/src/name/resolve.js
@@ -1,4 +1,3 @@
-/* eslint max-nested-callbacks: ["error", 6] */
/* eslint-env mocha */
'use strict'
@@ -10,7 +9,7 @@ module.exports = (createCommon, options) => {
const describe = getDescribe(options)
const it = getIt(options)
- describe('.name.resolve offline', function () {
+ describe('.name.resolve offline', () => {
const common = createCommon()
let ipfs
let nodeId
diff --git a/src/object/data.js b/src/object/data.js
index 1c31b1736..e2eeb5159 100644
--- a/src/object/data.js
+++ b/src/object/data.js
@@ -1,5 +1,4 @@
/* eslint-env mocha */
-/* eslint-disable max-nested-callbacks */
'use strict'
const bs58 = require('bs58')
@@ -16,7 +15,11 @@ module.exports = (createCommon, options) => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/object/get.js b/src/object/get.js
index 1ca870d22..c4f662dfa 100644
--- a/src/object/get.js
+++ b/src/object/get.js
@@ -19,7 +19,11 @@ module.exports = (createCommon, options) => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/object/links.js b/src/object/links.js
index 10400d911..0770ef219 100644
--- a/src/object/links.js
+++ b/src/object/links.js
@@ -1,5 +1,4 @@
/* eslint-env mocha */
-/* eslint-disable max-nested-callbacks */
'use strict'
const dagPB = require('ipld-dag-pb')
@@ -19,7 +18,11 @@ module.exports = (createCommon, options) => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/object/new.js b/src/object/new.js
index b4732932c..6f20522d0 100644
--- a/src/object/new.js
+++ b/src/object/new.js
@@ -13,7 +13,11 @@ module.exports = (createCommon, options) => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/object/patch/add-link.js b/src/object/patch/add-link.js
index c221f051d..1e97a70ba 100644
--- a/src/object/patch/add-link.js
+++ b/src/object/patch/add-link.js
@@ -16,7 +16,11 @@ module.exports = (createCommon, options) => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/object/patch/append-data.js b/src/object/patch/append-data.js
index 3a35a958e..0364c12ed 100644
--- a/src/object/patch/append-data.js
+++ b/src/object/patch/append-data.js
@@ -1,5 +1,4 @@
/* eslint-env mocha */
-/* eslint-disable max-nested-callbacks */
'use strict'
const { getDescribe, getIt, expect } = require('../../utils/mocha')
@@ -14,7 +13,11 @@ module.exports = (createCommon, options) => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/object/patch/rm-link.js b/src/object/patch/rm-link.js
index 331226837..f12ffefa7 100644
--- a/src/object/patch/rm-link.js
+++ b/src/object/patch/rm-link.js
@@ -14,7 +14,11 @@ module.exports = (createCommon, options) => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/object/patch/set-data.js b/src/object/patch/set-data.js
index b65afab97..1163b9521 100644
--- a/src/object/patch/set-data.js
+++ b/src/object/patch/set-data.js
@@ -1,5 +1,4 @@
/* eslint-env mocha */
-/* eslint-disable max-nested-callbacks */
'use strict'
const { getDescribe, getIt, expect } = require('../../utils/mocha')
@@ -14,7 +13,11 @@ module.exports = (createCommon, options) => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/object/put.js b/src/object/put.js
index da9e885ee..c1383e7f4 100644
--- a/src/object/put.js
+++ b/src/object/put.js
@@ -17,7 +17,11 @@ module.exports = (createCommon, options) => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/object/stat.js b/src/object/stat.js
index edac169c7..12c80b7d1 100644
--- a/src/object/stat.js
+++ b/src/object/stat.js
@@ -1,5 +1,4 @@
/* eslint-env mocha */
-/* eslint-disable max-nested-callbacks */
'use strict'
const dagPB = require('ipld-dag-pb')
@@ -17,7 +16,11 @@ module.exports = (createCommon, options) => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/pin/add.js b/src/pin/add.js
index 379ff6543..d8789080c 100644
--- a/src/pin/add.js
+++ b/src/pin/add.js
@@ -10,11 +10,15 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.pin.add', function () {
- this.timeout(60 * 1000)
+ this.timeout(50 * 1000)
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
await Promise.all(fixtures.files.map(file => {
return ipfs.add(file.data, { pin: false })
diff --git a/src/pin/ls.js b/src/pin/ls.js
index 4d598281c..47caed6c3 100644
--- a/src/pin/ls.js
+++ b/src/pin/ls.js
@@ -10,11 +10,15 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.pin.ls', function () {
- this.timeout(60 * 1000)
+ this.timeout(50 * 1000)
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
// two files wrapped in directories, only root CID pinned recursively
const dir = fixtures.directory.files.map((file) => ({ path: file.path, content: file.data }))
diff --git a/src/pin/rm.js b/src/pin/rm.js
index 7b8e5dc58..6be13effe 100644
--- a/src/pin/rm.js
+++ b/src/pin/rm.js
@@ -10,11 +10,15 @@ module.exports = (createCommon, options) => {
const common = createCommon()
describe('.pin.rm', function () {
- this.timeout(60 * 1000)
+ this.timeout(50 * 1000)
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
await ipfs.add(fixtures.files[0].data, { pin: false })
await ipfs.pin.add(fixtures.files[0].cid, { recursive: true })
diff --git a/src/ping/ping.js b/src/ping/ping.js
index 95b914826..030a77f16 100644
--- a/src/ping/ping.js
+++ b/src/ping/ping.js
@@ -15,7 +15,11 @@ module.exports = (createCommon, options) => {
let ipfsA
let ipfsB
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfsA = await common.setup()
ipfsB = await common.setup()
await ipfsA.swarm.connect(ipfsB.peerId.addresses[0])
diff --git a/src/pubsub/ls.js b/src/pubsub/ls.js
index 126be18ba..daf2e3586 100644
--- a/src/pubsub/ls.js
+++ b/src/pubsub/ls.js
@@ -16,7 +16,11 @@ module.exports = (createCommon, options) => {
let ipfs
let subscribedTopics = []
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/pubsub/peers.js b/src/pubsub/peers.js
index 01084d2d5..88bef2d65 100644
--- a/src/pubsub/peers.js
+++ b/src/pubsub/peers.js
@@ -18,7 +18,11 @@ module.exports = (createCommon, options) => {
let ipfs3
let subscribedTopics = []
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(100 * 1000)
+
ipfs1 = await common.setup()
ipfs2 = await common.setup()
ipfs3 = await common.setup()
diff --git a/src/pubsub/publish.js b/src/pubsub/publish.js
index 6eba0061f..3b8e93fcd 100644
--- a/src/pubsub/publish.js
+++ b/src/pubsub/publish.js
@@ -15,7 +15,11 @@ module.exports = (createCommon, options) => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/pubsub/subscribe.js b/src/pubsub/subscribe.js
index be5093fc0..103aa937e 100644
--- a/src/pubsub/subscribe.js
+++ b/src/pubsub/subscribe.js
@@ -1,5 +1,4 @@
/* eslint-env mocha */
-/* eslint max-nested-callbacks: ["error", 6] */
'use strict'
const pushable = require('it-pushable')
@@ -21,7 +20,11 @@ module.exports = (createCommon, options) => {
let topic
let subscribedTopics = []
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(100 * 1000)
+
ipfs1 = await common.setup()
ipfs2 = await common.setup()
})
diff --git a/src/pubsub/unsubscribe.js b/src/pubsub/unsubscribe.js
index dd0be0f9a..2fe522df7 100644
--- a/src/pubsub/unsubscribe.js
+++ b/src/pubsub/unsubscribe.js
@@ -16,7 +16,11 @@ module.exports = (createCommon, options) => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/repo/gc.js b/src/repo/gc.js
index 11fded58a..2c29c2dea 100644
--- a/src/repo/gc.js
+++ b/src/repo/gc.js
@@ -9,11 +9,14 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()
- describe('.repo.gc', function () {
- this.timeout(60 * 1000)
+ describe('.repo.gc', () => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/repo/stat.js b/src/repo/stat.js
index 662c24035..aaa7ad4b7 100644
--- a/src/repo/stat.js
+++ b/src/repo/stat.js
@@ -9,11 +9,14 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()
- describe('.repo.stat', function () {
- this.timeout(60 * 1000)
+ describe('.repo.stat', () => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/repo/version.js b/src/repo/version.js
index 99c084326..d8384e383 100644
--- a/src/repo/version.js
+++ b/src/repo/version.js
@@ -8,11 +8,14 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()
- describe('.repo.version', function () {
- this.timeout(60 * 1000)
+ describe('.repo.version', () => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/stats/bitswap.js b/src/stats/bitswap.js
index 37a41828c..61bca7e61 100644
--- a/src/stats/bitswap.js
+++ b/src/stats/bitswap.js
@@ -12,7 +12,11 @@ module.exports = (createCommon, options) => {
describe('.stats.bitswap', () => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/stats/bw-pull-stream.js b/src/stats/bw-pull-stream.js
index 6d3c39331..97d96193c 100644
--- a/src/stats/bw-pull-stream.js
+++ b/src/stats/bw-pull-stream.js
@@ -10,11 +10,14 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()
- describe('.stats.bwPullStream', function () {
- this.timeout(60 * 1000)
+ describe('.stats.bwPullStream', () => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/stats/bw-readable-stream.js b/src/stats/bw-readable-stream.js
index 6ab0c711e..50e0a8c0d 100644
--- a/src/stats/bw-readable-stream.js
+++ b/src/stats/bw-readable-stream.js
@@ -10,11 +10,14 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()
- describe('.stats.bwReadableStream', function () {
- this.timeout(60 * 1000)
+ describe('.stats.bwReadableStream', () => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/stats/bw.js b/src/stats/bw.js
index 13937c77d..7994bca84 100644
--- a/src/stats/bw.js
+++ b/src/stats/bw.js
@@ -9,11 +9,14 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()
- describe('.stats.bw', function () {
- this.timeout(60 * 1000)
+ describe('.stats.bw', () => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})
diff --git a/src/stats/repo.js b/src/stats/repo.js
index 792449307..e6fae8d37 100644
--- a/src/stats/repo.js
+++ b/src/stats/repo.js
@@ -9,11 +9,14 @@ module.exports = (createCommon, options) => {
const it = getIt(options)
const common = createCommon()
- describe('.stats.repo', function () {
- this.timeout(60 * 1000)
+ describe('.stats.repo', () => {
let ipfs
- before(async () => {
+ before(async function () {
+ // CI takes longer to instantiate the daemon, so we need to increase the
+ // timeout for the before step
+ this.timeout(60 * 1000)
+
ipfs = await common.setup()
})