Skip to content

Commit a4d73b9

Browse files
committed
test: remove timeout/slow calls
1 parent e4b2462 commit a4d73b9

11 files changed

+2
-36
lines changed

.vscode/settings.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
},
1414
"mochaExplorer.parallel": true,
1515
"mochaExplorer.globImplementation": "vscode",
16-
"mochaExplorer.nodeArgv": [
17-
"--expose-gc"
18-
],
16+
"mochaExplorer.nodeArgv": ["--expose-gc"],
1917
"mochaExplorer.debuggerConfig": "JS-Attach",
2018
"files.exclude": {
2119
"**/.DS_Store": true,

test/unit/compat/socket-router-test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ if (process.env.INCLUDE_COMPAT_TESTS) {
7272
})
7373

7474
it("should handle router-dealer message bursts", function (done) {
75-
this.slow(150)
7675
// tests https://github.com/JustinTulloss/zeromq.node/issues/523
7776
// based on https://gist.github.com/messa/862638ab44ca65f712fe4d6ef79aeb67
7877

test/unit/context-process-exit-test.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {createProcess} from "./helpers"
77
describe("context process exit", function () {
88
describe("with default context", function () {
99
it("should occur when sockets are closed", async function () {
10-
this.slow(200)
1110
const {code} = await createProcess(() => {
1211
const socket1 = new zmq.Dealer()
1312
socket1.close()
@@ -19,7 +18,6 @@ describe("context process exit", function () {
1918
})
2019

2120
it("should occur when sockets are not closed", async function () {
22-
this.slow(200)
2321
const {code} = await createProcess(() => {
2422
const socket1 = new zmq.Dealer()
2523
const socket2 = new zmq.Router()
@@ -29,7 +27,6 @@ describe("context process exit", function () {
2927
})
3028

3129
it("should not occur when sockets are open and polling", async function () {
32-
this.slow(1000)
3330
const {code, isTimeout} = await createProcess(() => {
3431
const socket1 = new zmq.Dealer()
3532
socket1.connect("inproc://foo")
@@ -43,7 +40,6 @@ describe("context process exit", function () {
4340
})
4441

4542
it("should produce warning when messages are queued with blocky", async function () {
46-
this.slow(2000)
4743
const {stderr} = await createProcess(() => {
4844
zmq.context.blocky = true
4945
const socket1 = new zmq.Dealer({linger: 1000})
@@ -67,7 +63,6 @@ describe("context process exit", function () {
6763
})
6864

6965
it("should produce warning when messages are queued without blocky", async function () {
70-
this.slow(2000)
7166
const {stderr} = await createProcess(() => {
7267
zmq.context.blocky = false
7368
const socket1 = new zmq.Dealer({linger: 1000})
@@ -84,7 +79,6 @@ describe("context process exit", function () {
8479
})
8580

8681
it("should not produce warning when messages are queued for a short time", async function () {
87-
this.slow(1000)
8882
const {stderr} = await createProcess(() => {
8983
zmq.context.blocky = true
9084
const socket1 = new zmq.Dealer({linger: 50})
@@ -100,7 +94,6 @@ describe("context process exit", function () {
10094

10195
describe("with custom context", function () {
10296
it("should occur when sockets are closed", async function () {
103-
this.slow(200)
10497
const {code} = await createProcess(() => {
10598
const context = new zmq.Context()
10699
const socket1 = new zmq.Dealer({context})
@@ -113,7 +106,6 @@ describe("context process exit", function () {
113106
})
114107

115108
it("should occur when sockets are closed and context is gced", async function () {
116-
this.slow(200)
117109
const {code} = await createProcess(() => {
118110
function run() {
119111
const context = new zmq.Context()
@@ -131,7 +123,6 @@ describe("context process exit", function () {
131123
})
132124

133125
it("should occur when sockets are not closed", async function () {
134-
this.slow(200)
135126
const {code} = await createProcess(() => {
136127
const context = new zmq.Context()
137128
const socket1 = new zmq.Dealer({context})
@@ -142,7 +133,6 @@ describe("context process exit", function () {
142133
})
143134

144135
it("should not occur when sockets are open and polling", async function () {
145-
this.slow(1000)
146136
const {code, isTimeout} = await createProcess(() => {
147137
const context = new zmq.Context()
148138
const socket1 = new zmq.Dealer({context})

test/unit/context-thread-test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ import {assert} from "chai"
55
import {createWorker} from "./helpers"
66

77
describe("context in thread", function () {
8-
this.slow(2000)
9-
this.timeout(5000)
10-
118
beforeEach(function () {
129
/* Node.js worker support introduced in version 10.5. */
1310
if (semver.satisfies(process.versions.node, "< 10.5")) {

test/unit/socket-close-test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ for (const proto of testProtos("tcp", "ipc", "inproc")) {
108108

109109
it("should release reference to context", async function () {
110110
const gc = getGcOrSkipTest(this)
111-
this.slow(200)
112111

113112
let weakRef: undefined | WeakRef<zmq.Context>
114113

@@ -138,7 +137,7 @@ for (const proto of testProtos("tcp", "ipc", "inproc")) {
138137
// if (process.env.SKIP_GC_FINALIZER_TESTS) {
139138
// this.skip()
140139
// }
141-
// this.slow(200)
140+
//
142141

143142
// let weakRef: undefined | WeakRef<zmq.Context>
144143
// const task = async () => {

test/unit/socket-events-test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ for (const proto of testProtos("tcp", "ipc", "inproc")) {
5454
})
5555

5656
it("should receive connect events", async function () {
57-
this.slow(250)
5857
const address = await uniqAddress(proto)
5958

6059
const [event] = await Promise.all([

test/unit/socket-process-exit-test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {createProcess} from "./helpers"
66
describe("socket process exit", function () {
77
/* Reported: https://github.com/nodejs/node-addon-api/issues/591 */
88
it.skip("should occur cleanly when sending in exit hook", async function () {
9-
this.slow(200)
109
const {code} = await createProcess(async () => {
1110
const sockA = new zmq.Pair()
1211
const sockB = new zmq.Pair()
@@ -24,7 +23,6 @@ describe("socket process exit", function () {
2423
})
2524

2625
it("should occur cleanly when sending on unbound socket", async function () {
27-
this.slow(200)
2826
const {code} = await createProcess(async () => {
2927
const sock = new zmq.Publisher()
3028
await sock.send("test")
@@ -34,7 +32,6 @@ describe("socket process exit", function () {
3432
})
3533

3634
it("should not occur when sending and blocked on unbound socket", async function () {
37-
this.slow(1000)
3835
const {code} = await createProcess(async () => {
3936
const sock = new zmq.Dealer()
4037
await sock.send("test")
@@ -44,7 +41,6 @@ describe("socket process exit", function () {
4441
})
4542

4643
it("should occur cleanly on socket close when reading events", async function () {
47-
this.slow(200)
4844
const {code} = await createProcess(() => {
4945
const sock = new zmq.Dealer()
5046

@@ -63,7 +59,6 @@ describe("socket process exit", function () {
6359
})
6460

6561
it("should not occur while reading events", async function () {
66-
this.slow(1000)
6762
const {code} = await createProcess(async () => {
6863
const sock = new zmq.Dealer()
6964

test/unit/socket-send-receive-test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,6 @@ for (const proto of testProtos("tcp", "ipc", "inproc")) {
265265
})
266266

267267
it("should poll simultaneously", async function () {
268-
this.timeout(5000)
269-
270268
const sendReceiveA = async () => {
271269
const [msg1] = await Promise.all([
272270
sockA.receive(),
@@ -426,8 +424,6 @@ for (const proto of testProtos("tcp", "ipc", "inproc")) {
426424
}
427425

428426
it("should not starve event loop", async function () {
429-
this.slow(250)
430-
431427
sockA.sendHighWaterMark = 5000
432428
sockB.receiveHighWaterMark = 5000
433429

test/unit/socket-thread-test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ import {createWorker, testProtos, uniqAddress} from "./helpers"
66

77
for (const proto of testProtos("tcp", "ipc", "inproc")) {
88
describe(`socket with ${proto} in thread`, function () {
9-
this.slow(2000)
10-
this.timeout(5000)
11-
129
beforeEach(function () {
1310
/* Node.js worker support introduced in version 10.5. */
1411
if (semver.satisfies(process.versions.node, "< 10.5")) {

test/unit/socket-zap-test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,6 @@ for (const proto of testProtos("tcp", "ipc")) {
167167
this.skip()
168168
}
169169

170-
this.slow(250)
171-
172170
sockA.plainServer = true
173171
sockB.curveServer = true
174172

0 commit comments

Comments
 (0)