Skip to content

Commit 8c06d7e

Browse files
committed
test: avoid blockage when running compat tests
1 parent 93efd26 commit 8c06d7e

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

.mocharc.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ const config = {
88
"v8-expose-gc": true,
99
exit: true,
1010
parallel: true,
11-
timeout: 10000,
12-
retries: 3,
11+
timeout: 5000,
12+
retries: 2,
13+
fullTrace: true
1314
}
1415

1516
module.exports = config

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@
9898
"build.native.debug": "cmake-ts dev-os-only",
9999
"build": "run-p build.js build.native",
100100
"build.debug": "run-s build.js build.native.debug",
101-
"test": "run-s clean.temp build test.run",
102-
"test.run": "cross-env INCLUDE_COMPAT_TESTS=true mocha",
101+
"test": "run-s clean.temp test.unit.compat clean.temp test.unit",
102+
"test.unit": "cross-env INCLUDE_COMPAT_TESTS=false mocha ./test/unit/*-test.ts",
103+
"test.unit.compat": "cross-env INCLUDE_COMPAT_TESTS=true mocha ./test/unit/compat/*-test.ts",
103104
"test.smoke": "bash ./script/smoke-test.bash",
104105
"test.skip_gc_tests": "run-s clean.temp build.debug && cross-env SKIP_GC_TESTS=true mocha",
105106
"test.electron.main": "run-s clean.temp build && electron-mocha",

test/unit/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if (semver.satisfies(zmq.version, ">= 4.2")) {
1919
*/
2020
let idFallback = 5000
2121
async function getUniqueId() {
22-
const idPath = path.resolve(__dirname, "../../tmp/id")
22+
const idPath = path.resolve(__dirname, "../../tmp/port-id.lock")
2323
await fs.promises.mkdir(path.dirname(idPath), {recursive: true})
2424

2525
try {

test/unit/proxy-router-dealer-test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,16 @@ for (const proto of testProtos("tcp", "ipc", "inproc")) {
8989
rep.close()
9090
}
9191

92-
console.log("waiting for messages")
92+
console.log(
93+
`waiting for messages for proxy with ${proto} router/dealer...`,
94+
)
9395

9496
await Promise.all([echo(), send()])
9597
assert.deepEqual(received, messages)
9698

9799
proxy.terminate()
98100
await done
101+
console.log(`Done proxying with ${proto} router/dealer`)
99102
})
100103
})
101104
})

0 commit comments

Comments
 (0)