Skip to content

Commit

Permalink
test: rename some allegories
Browse files Browse the repository at this point in the history
PR-URL: #22307
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Jon Moss <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
  • Loading branch information
vsemozhetbyt authored and rvagg committed Aug 15, 2018
1 parent 1d15f33 commit 9d89b3c
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 29 deletions.
14 changes: 7 additions & 7 deletions test/internet/test-dgram-broadcast-multi-process.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ if (process.argv[2] !== 'child') {
TIMEOUT);
console.error('[PARENT] Fail');

killChildren(workers);
killSubprocesses(workers);

process.exit(1);
}, TIMEOUT);
Expand Down Expand Up @@ -102,7 +102,7 @@ if (process.argv[2] !== 'child') {
console.error('[PARENT] All workers have died.');
console.error('[PARENT] Fail');

killChildren(workers);
killSubprocesses(workers);

process.exit(1);
}
Expand Down Expand Up @@ -155,7 +155,7 @@ if (process.argv[2] !== 'child') {

clearTimeout(timer);
console.error('[PARENT] Success');
killChildren(workers);
killSubprocesses(workers);
}
}
});
Expand Down Expand Up @@ -203,10 +203,10 @@ if (process.argv[2] !== 'child') {
);
};

function killChildren(children) {
Object.keys(children).forEach(function(key) {
const child = children[key];
child.kill();
function killSubprocesses(subprocesses) {
Object.keys(subprocesses).forEach(function(key) {
const subprocess = subprocesses[key];
subprocess.kill();
});
}
}
Expand Down
12 changes: 6 additions & 6 deletions test/internet/test-dgram-multicast-multi-process.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,16 @@ function launchChildProcess() {

clearTimeout(timer);
console.error('[PARENT] Success');
killChildren(workers);
killSubprocesses(workers);
}
}
});
}

function killChildren(children) {
Object.keys(children).forEach(function(key) {
const child = children[key];
child.kill();
function killSubprocesses(subprocesses) {
Object.keys(subprocesses).forEach(function(key) {
const subprocess = subprocesses[key];
subprocess.kill();
});
}

Expand All @@ -141,7 +141,7 @@ if (process.argv[2] !== 'child') {
TIMEOUT);
console.error('[PARENT] Fail');

killChildren(workers);
killSubprocesses(workers);

process.exit(1);
}, TIMEOUT);
Expand Down
12 changes: 6 additions & 6 deletions test/internet/test-dgram-multicast-set-interface-lo.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ if (process.argv[2] !== 'child') {
TIMEOUT);
console.error('[PARENT] Skip');

killChildren(workers);
killSubprocesses(workers);
common.skip('Check filter policy');

process.exit(1);
Expand Down Expand Up @@ -132,7 +132,7 @@ if (process.argv[2] !== 'child') {
console.error('[PARENT] All workers have died.');
console.error('[PARENT] Fail');

killChildren(workers);
killSubprocesses(workers);

process.exit(1);
}
Expand Down Expand Up @@ -187,7 +187,7 @@ if (process.argv[2] !== 'child') {

clearTimeout(timer);
console.error('[PARENT] Success');
killChildren(workers);
killSubprocesses(workers);
}
}
});
Expand Down Expand Up @@ -239,9 +239,9 @@ if (process.argv[2] !== 'child') {
);
};

function killChildren(children) {
for (const i in children)
children[i].kill();
function killSubprocesses(subprocesses) {
for (const i in subprocesses)
subprocesses[i].kill();
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-child-process-fork-net.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ if (process.argv[2] === 'child') {
while (j--) {
const client = net.connect(this.address().port, '127.0.0.1');
client.on('error', function() {
// This can happen if we kill the child too early.
// This can happen if we kill the subprocess too early.
// The client should still get a close event afterwards.
console.error('[m] CLIENT: error event');
});
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-listen-fd-detached-inherit.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function test() {
function next() {
console.error('output from parent = %s', json);
const child = JSON.parse(json);
// now make sure that we can request to the child, then kill it.
// now make sure that we can request to the subprocess, then kill it.
http.get({
server: 'localhost',
port: child.port,
Expand All @@ -64,7 +64,7 @@ function test() {
s += c.toString();
});
res.on('end', function() {
// kill the child before we start doing asserts.
// kill the subprocess before we start doing asserts.
// it's really annoying when tests leave orphans!
process.kill(child.pid, 'SIGKILL');
try {
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-listen-fd-detached.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function test() {
function next() {
console.error('output from parent = %s', json);
const child = JSON.parse(json);
// now make sure that we can request to the child, then kill it.
// now make sure that we can request to the subprocess, then kill it.
http.get({
server: 'localhost',
port: child.port,
Expand All @@ -64,7 +64,7 @@ function test() {
s += c.toString();
});
res.on('end', function() {
// kill the child before we start doing asserts.
// kill the subprocess before we start doing asserts.
// it's really annoying when tests leave orphans!
process.kill(child.pid, 'SIGKILL');
try {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-listen-fd-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ process.on('exit', function() {
// concurrency in HTTP servers! Use the cluster module, or if you want
// a more low-level approach, use child process IPC manually.
test(function(child, port) {
// now make sure that we can request to the child, then kill it.
// now make sure that we can request to the subprocess, then kill it.
http.get({
server: 'localhost',
port: port,
Expand Down
8 changes: 4 additions & 4 deletions test/sequential/test-child-process-fork-getconnections.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ if (process.argv[2] === 'child') {
const child = fork(process.argv[1], ['child']);

child.on('exit', function(code, signal) {
if (!childKilled)
throw new Error('child died unexpectedly!');
if (!subprocessKilled)
throw new Error('subprocess died unexpectedly!');
});

const server = net.createServer();
Expand All @@ -86,10 +86,10 @@ if (process.argv[2] === 'child') {
}
});

let childKilled = false;
let subprocessKilled = false;
function closeSockets(i) {
if (i === count) {
childKilled = true;
subprocessKilled = true;
server.close();
child.kill();
return;
Expand Down

0 comments on commit 9d89b3c

Please sign in to comment.