Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3b193de

Browse filesBrowse files
Trottaddaleax
authored andcommitted
test: fix flaky test-cluster-dgram-2
There is no guarantee that a dgram packet will be received. The test is currently written to only send exactly as many dgram packets as required assuming they are all received. As a result, failures like this may occur (from CI): ``` not ok 719 parallel/test-cluster-dgram-2 --- duration_ms: 120.39 severity: fail stack: |- timeout ``` This change has the workers send packets continuously until disconnect. PR-URL: #9791 Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
1 parent 3f1b068 commit 3b193de
Copy full SHA for 3b193de

File tree

Expand file treeCollapse file tree

1 file changed

+8
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-1
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-cluster-dgram-2.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-cluster-dgram-2.js
+8-1Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ function worker() {
5757
// send(), explicitly bind them to an ephemeral port.
5858
socket.bind(0);
5959

60-
for (var i = 0; i < PACKETS_PER_WORKER; i++)
60+
// There is no guarantee that a sent dgram packet will be received so keep
61+
// sending until disconnect.
62+
const interval = setInterval(() => {
6163
socket.send(buf, 0, buf.length, common.PORT, '127.0.0.1');
64+
}, 1);
65+
66+
cluster.worker.on('disconnect', () => {
67+
clearInterval(interval);
68+
});
6269
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.