Skip to content

Commit a38b614

Browse files
TrottMyles Borins
authored and
Myles Borins
committed
test: fix flaky test-child-process-fork-net
Reduce client connections from 10 to 4 in a test that is causing issues on Raspberry Pi 2 devices in CI. Fixes: #5122 PR-URL: #6138 Reviewed-By: Benjamin Gruenbaum <[email protected]>
1 parent fabc33a commit a38b614

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test/parallel/test-child-process-fork-net.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
2-
var assert = require('assert');
3-
var common = require('../common');
4-
var fork = require('child_process').fork;
5-
var net = require('net');
2+
const assert = require('assert');
3+
const common = require('../common');
4+
const fork = require('child_process').fork;
5+
const net = require('net');
66

77
// progress tracker
88
function ProgressTracker(missing, callback) {
@@ -76,9 +76,9 @@ if (process.argv[2] === 'child') {
7676
server.close();
7777
});
7878

79-
// we expect 10 connections and close events
80-
var connections = new ProgressTracker(10, progress.done.bind(progress));
81-
var closed = new ProgressTracker(10, progress.done.bind(progress));
79+
// we expect 4 connections and close events
80+
var connections = new ProgressTracker(4, progress.done.bind(progress));
81+
var closed = new ProgressTracker(4, progress.done.bind(progress));
8282

8383
// create server and send it to child
8484
var server = net.createServer();
@@ -99,7 +99,7 @@ if (process.argv[2] === 'child') {
9999
if (msg.what === 'listening') {
100100
// make connections
101101
var socket;
102-
for (var i = 0; i < 10; i++) {
102+
for (var i = 0; i < 4; i++) {
103103
socket = net.connect(common.PORT, function() {
104104
console.log('CLIENT: connected');
105105
});

0 commit comments

Comments
 (0)