Run one replication test only (for @diasdavid)

This commit is contained in:
haad 2017-02-15 17:54:12 +01:00
parent c2912be189
commit 49c30b3ec0
2 changed files with 26 additions and 5 deletions

View File

@ -6,7 +6,16 @@ module.exports = {
Swarm: ['/ip4/0.0.0.0/tcp/0'],
Gateway: '/ip4/0.0.0.0/tcp/0'
},
// Bootstrap: []
Discovery: {
MDNS: {
Enabled: true,
Interval: 10
},
webRTCStar: {
Enabled: true
}
},
Bootstrap: []
},
daemon2: {
IpfsDataDir: '/tmp/orbit-db-tests-2',
@ -15,6 +24,15 @@ module.exports = {
Swarm: ['/ip4/0.0.0.0/tcp/0'],
Gateway: '/ip4/0.0.0.0/tcp/0'
},
// Bootstrap: []
Discovery: {
MDNS: {
Enabled: true,
Interval: 10
},
webRTCStar: {
Enabled: true
}
},
Bootstrap: []
},
}

View File

@ -32,10 +32,13 @@ const hasIpfsApiWithPubsub = (ipfs) => {
const waitForPeers = (ipfs, channel) => {
return new Promise((resolve) => {
console.log("Waiting for peers...")
console.log("Waiting for peers for '" + channel + "'...")
const interval = setInterval(() => {
ipfs.pubsub.peers(channel)
// The tests pass if used with swarm.peers (peers find each other)
// ipfs.swarm.peers()
.then((peers) => {
// console.log(peers)
if (peers.length > 0) {
clearInterval(interval)
resolve()
@ -72,7 +75,7 @@ const waitForPeers = (ipfs, channel) => {
assert.equal(hasIpfsApiWithPubsub(ipfs2), true)
client1 = new OrbitDB(ipfs1, databaseName)
client2 = new OrbitDB(ipfs2, databaseName + '2')
done()
done()
})
})
})
@ -89,7 +92,7 @@ const waitForPeers = (ipfs, channel) => {
db2 = client2.eventlog(databaseName, { maxHistory: 0 })
})
it('replicates database of 1 entry', (done) => {
it.only('replicates database of 1 entry', (done) => {
waitForPeers(ipfs1, databaseName + '2')
.then(async(() => {
db2.events.on('history', (db, data) => {