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

Commit 132f559

Browse files
vmxdaviddias
authored andcommitted
test: increase number of nodes for DHT tests
The DHT doesn't work well with a low number of peers (the more the better). Hence increase it to 5 peers. This should make the test more reliable.
1 parent a45e8aa commit 132f559

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

js/src/dht.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ module.exports = (common) => {
3030
let nodeA
3131
let nodeB
3232
let nodeC
33+
let nodeD
34+
let nodeE
3335

3436
before(function (done) {
3537
// CI takes longer to instantiate the daemon, so we need to increase the
@@ -39,6 +41,8 @@ module.exports = (common) => {
3941
common.setup((err, factory) => {
4042
expect(err).to.not.exist()
4143
series([
44+
(cb) => spawnWithId(factory, cb),
45+
(cb) => spawnWithId(factory, cb),
4246
(cb) => spawnWithId(factory, cb),
4347
(cb) => spawnWithId(factory, cb),
4448
(cb) => spawnWithId(factory, cb)
@@ -48,11 +52,20 @@ module.exports = (common) => {
4852
nodeA = nodes[0]
4953
nodeB = nodes[1]
5054
nodeC = nodes[2]
55+
nodeD = nodes[3]
56+
nodeE = nodes[4]
5157

5258
parallel([
5359
(cb) => nodeA.swarm.connect(nodeB.peerId.addresses[0], cb),
5460
(cb) => nodeB.swarm.connect(nodeC.peerId.addresses[0], cb),
55-
(cb) => nodeC.swarm.connect(nodeA.peerId.addresses[0], cb)
61+
(cb) => nodeC.swarm.connect(nodeA.peerId.addresses[0], cb),
62+
(cb) => nodeD.swarm.connect(nodeA.peerId.addresses[0], cb),
63+
(cb) => nodeE.swarm.connect(nodeA.peerId.addresses[0], cb),
64+
(cb) => nodeD.swarm.connect(nodeB.peerId.addresses[0], cb),
65+
(cb) => nodeE.swarm.connect(nodeB.peerId.addresses[0], cb),
66+
(cb) => nodeD.swarm.connect(nodeC.peerId.addresses[0], cb),
67+
(cb) => nodeE.swarm.connect(nodeC.peerId.addresses[0], cb),
68+
(cb) => nodeD.swarm.connect(nodeE.peerId.addresses[0], cb),
5669
], done)
5770
})
5871
})

0 commit comments

Comments
 (0)