Skip to content

Commit

Permalink
test: avoid blockage when running compat tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Oct 27, 2024
1 parent 93efd26 commit 8c06d7e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
5 changes: 3 additions & 2 deletions .mocharc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ const config = {
"v8-expose-gc": true,
exit: true,
parallel: true,
timeout: 10000,
retries: 3,
timeout: 5000,
retries: 2,
fullTrace: true
}

module.exports = config
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@
"build.native.debug": "cmake-ts dev-os-only",
"build": "run-p build.js build.native",
"build.debug": "run-s build.js build.native.debug",
"test": "run-s clean.temp build test.run",
"test.run": "cross-env INCLUDE_COMPAT_TESTS=true mocha",
"test": "run-s clean.temp test.unit.compat clean.temp test.unit",
"test.unit": "cross-env INCLUDE_COMPAT_TESTS=false mocha ./test/unit/*-test.ts",
"test.unit.compat": "cross-env INCLUDE_COMPAT_TESTS=true mocha ./test/unit/compat/*-test.ts",
"test.smoke": "bash ./script/smoke-test.bash",
"test.skip_gc_tests": "run-s clean.temp build.debug && cross-env SKIP_GC_TESTS=true mocha",
"test.electron.main": "run-s clean.temp build && electron-mocha",
Expand Down
2 changes: 1 addition & 1 deletion test/unit/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (semver.satisfies(zmq.version, ">= 4.2")) {
*/
let idFallback = 5000
async function getUniqueId() {
const idPath = path.resolve(__dirname, "../../tmp/id")
const idPath = path.resolve(__dirname, "../../tmp/port-id.lock")
await fs.promises.mkdir(path.dirname(idPath), {recursive: true})

try {
Expand Down
5 changes: 4 additions & 1 deletion test/unit/proxy-router-dealer-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,16 @@ for (const proto of testProtos("tcp", "ipc", "inproc")) {
rep.close()
}

console.log("waiting for messages")
console.log(
`waiting for messages for proxy with ${proto} router/dealer...`,
)

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

proxy.terminate()
await done
console.log(`Done proxying with ${proto} router/dealer`)
})
})
})
Expand Down

0 comments on commit 8c06d7e

Please sign in to comment.