Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix flaky test-child-process-fork-net #6138

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions test/parallel/test-child-process-fork-net.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';
var assert = require('assert');
var common = require('../common');
var fork = require('child_process').fork;
var net = require('net');
const assert = require('assert');
const common = require('../common');
const fork = require('child_process').fork;
const net = require('net');

// progress tracker
function ProgressTracker(missing, callback) {
Expand Down Expand Up @@ -76,9 +76,9 @@ if (process.argv[2] === 'child') {
server.close();
});

// we expect 10 connections and close events
var connections = new ProgressTracker(10, progress.done.bind(progress));
var closed = new ProgressTracker(10, progress.done.bind(progress));
// we expect 4 connections and close events
var connections = new ProgressTracker(4, progress.done.bind(progress));
var closed = new ProgressTracker(4, progress.done.bind(progress));

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