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

Commit aa79c56

Browse files
daviddiasvmx
authored andcommitted
fix: only skip if it is go-ipfs on Windows
1 parent 6aeca2f commit aa79c56

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

Diff for: js/src/pubsub.js

+28-5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ const whilst = require('async/whilst')
1313
const each = require('async/each')
1414
const hat = require('hat')
1515

16+
let isWindows = false
17+
if (process.platform && process.platform === 'win32') {
18+
isWindows = true
19+
}
20+
1621
function waitForPeers (ipfs, topic, peersToWait, callback) {
1722
const i = setInterval(() => {
1823
ipfs.pubsub.peers(topic, (err, peers) => {
@@ -67,6 +72,7 @@ module.exports = (common) => {
6772
let ipfs1
6873
let ipfs2
6974
let ipfs3
75+
let withGo
7076

7177
before(function (done) {
7278
// CI takes longer to instantiate the daemon, so we need to increase the
@@ -90,7 +96,12 @@ module.exports = (common) => {
9096
ipfs1 = nodes[0]
9197
ipfs2 = nodes[1]
9298
ipfs3 = nodes[2]
93-
done()
99+
100+
ipfs1.id((err, id) => {
101+
expect(err).to.not.exist()
102+
withGo = id.agentVersion.startsWith('go-ipfs')
103+
done()
104+
})
94105
})
95106
})
96107
})
@@ -497,7 +508,13 @@ module.exports = (common) => {
497508
})
498509
})
499510

500-
it('receive multiple messages', (done) => {
511+
it('receive multiple messages', function (done) {
512+
// TODO fix https://github.com/ipfs/interface-ipfs-core/pull/188#issuecomment-354673246
513+
// and https://github.com/ipfs/go-ipfs/issues/4778
514+
if (withGo && isWindows) {
515+
this.skip()
516+
}
517+
501518
const inbox1 = []
502519
const inbox2 = []
503520
const outbox = ['hello', 'world', 'this', 'is', 'pubsub']
@@ -566,16 +583,22 @@ module.exports = (common) => {
566583
let sub1
567584
let sub2
568585

569-
before(() => {
586+
beforeEach(function () {
587+
// TODO fix https://github.com/ipfs/interface-ipfs-core/pull/188#issuecomment-354673246
588+
// and https://github.com/ipfs/go-ipfs/issues/4778
589+
if (withGo && isWindows) {
590+
this.skip()
591+
}
592+
570593
topic = getTopic()
571594
})
572595

573-
after(() => {
596+
afterEach(() => {
574597
ipfs1.pubsub.unsubscribe(topic, sub1)
575598
ipfs2.pubsub.unsubscribe(topic, sub2)
576599
})
577600

578-
it.skip('send/receive 10k messages', function (done) {
601+
it('send/receive 10k messages', function (done) {
579602
this.timeout(2 * 60 * 1000)
580603

581604
const msgBase = 'msg - '

0 commit comments

Comments
 (0)