Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion benchmark/buffers/buffer-transcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const encodings = ['latin1', 'ascii', 'ucs2', 'utf8'];

if (!hasIntl) {
console.log('Skipping: `transcode` is only available on platforms that support i18n`');
process.exit(0);
return;
}

const bench = common.createBenchmark(main, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ if (process.argv[2] === 'child-buffer') {
v & 0xFF,
]);
const fd = process.channel?.fd;
if (fd === undefined) {
// skip test
process.exit(0);
if (fd !== undefined) {
fs.writeSync(fd, payload);
}
fs.writeSync(fd, payload);
return;
}

Expand Down
3 changes: 0 additions & 3 deletions test/parallel/test-child-process-internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ if (process.argv[2] === 'child') {

// Send internal message
process.send(internal);

process.exit(0);

} else {

const fork = require('child_process').fork;
Expand Down
6 changes: 2 additions & 4 deletions test/parallel/test-child-process-silent.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.

'use strict';
require('../common');
const common = require('../common');
const assert = require('assert');
const childProcess = require('child_process');

Expand All @@ -44,9 +44,7 @@ if (process.argv[2] === 'pipe') {
// Allow child process to self terminate
child.disconnect();

child.on('exit', function() {
process.exit(0);
});
child.on('exit', common.mustCall());

} else {
// Testcase | start primary && child IPC test
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-child-process-spawnsync-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ if (process.argv.includes('spawnchild')) {
checkSpawnSyncRet(ret);
break;
}
process.exit(0);
return;
}

Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-child-process-stdout-flush-exit.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ if (process.argv[2] === 'child') {
console.log('filler');
}
console.log('goodbye');
process.exit(0);
} else {
// parent process
const spawn = require('child_process').spawn;
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-cli-eval.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const fixtures = require('../common/fixtures');

if (process.argv.length > 2) {
console.log(process.argv.slice(2).join(' '));
process.exit(0);
return;
}

// Assert that nothing is written to stdout.
Expand Down
12 changes: 4 additions & 8 deletions test/parallel/test-inspector-port-zero-cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function serialFork() {

if (cluster.isPrimary) {
Promise.all([serialFork(), serialFork(), serialFork()])
.then(common.mustCall((ports) => {
.then((ports) => {
ports.splice(0, 0, process.debugPort);
// 4 = [primary, worker1, worker2, worker3].length()
assert.strictEqual(ports.length, 4);
Expand All @@ -44,12 +44,8 @@ if (cluster.isPrimary) {
assert.strictEqual(ports[0] === 65535 ? 1024 : ports[0] + 1, ports[1]);
assert.strictEqual(ports[1] === 65535 ? 1024 : ports[1] + 1, ports[2]);
assert.strictEqual(ports[2] === 65535 ? 1024 : ports[2] + 1, ports[3]);
}))
.catch(
(err) => {
console.error(err);
process.exit(1);
});
})
.then(common.mustCall());
} else {
process.exit(0);
process.disconnect();
}
2 changes: 1 addition & 1 deletion test/parallel/test-net-listen-twice.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (cluster.isPrimary) {
server.listen();
} catch (e) {
console.error(e);
process.exit(0);
return;
}
let i = 0;
process.on('internalMessage', (msg) => {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-permission-allow-child-process-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (process.argv[2] === 'child') {
code: 'ERR_ACCESS_DENIED',
permission: 'FileSystemWrite',
}));
process.exit(0);
return;
}

// Guarantee the initial state
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-permission-allow-worker-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const assert = require('assert');
const { isMainThread, Worker } = require('worker_threads');

if (!isMainThread) {
process.exit(0);
return;
}

// Guarantee the initial state
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-permission-child-process-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const assert = require('assert');
const childProcess = require('child_process');

if (process.argv[2] === 'child') {
process.exit(0);
return;
}

// Guarantee the initial state
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-process-env.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if (process.argv[2] === 'you-are-the-child') {
assert.strictEqual(process.env[42], 'forty-two');
const has = Object.hasOwn(process.env, 'hasOwnProperty');
assert.strictEqual(has, true);
process.exit(0);
return;
}

{
Expand Down
18 changes: 7 additions & 11 deletions test/parallel/test-trace-exit.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,22 @@ const { Worker, isMainThread, workerData } = require('worker_threads');

const variant = process.argv[process.argv.length - 1];
switch (true) {
case variant === 'main-thread': {
return;
}
case variant === 'main-thread-exit': {
case isMainThread ? variant === 'main-thread-exit' : workerData === 'worker-thread-exit':
return process.exit(0);
}
case variant.startsWith('worker-thread'): {
const worker = new Worker(__filename, { workerData: variant });
worker.on('error', common.mustNotCall());
worker.on('exit', common.mustCall((code) => {
assert.strictEqual(code, 0);
}));
return;
}
case !isMainThread: {
if (workerData === 'worker-thread-exit') {
process.exit(0);
}
// eslint-disable-next-line no-fallthrough
case variant === 'main-thread':
// eslint-disable-next-line no-fallthrough
case variant === 'main-thread-exit':
// eslint-disable-next-line no-fallthrough
case !isMainThread:
return;
}
}

(async function() {
Expand Down
2 changes: 0 additions & 2 deletions test/parallel/test-worker-safe-getters.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,4 @@ if (isMainThread) {
assert.strictEqual(w.stdout, stdout);
assert.strictEqual(w.stderr, stderr);
}));
} else {
process.exit(0);
}
1 change: 0 additions & 1 deletion test/parallel/test-worker-stdio-flush-inflight.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ if (isMainThread) {
process.stdout.write('hello');
process.stdout.write(' ');
process.stdout.write('world');
process.exit(0);
}
1 change: 0 additions & 1 deletion test/parallel/test-worker-thread-name.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const name = 'test-worker-thread-name';

if (workerData?.isWorker) {
assert.strictEqual(threadName, name);
process.exit(0);
} else {
const w = new Worker(__filename, { name, workerData: { isWorker: true } });
assert.strictEqual(w.threadName, name);
Expand Down
Loading