Skip to content

Commit 50f0660

Browse files
lpincatargos
authored andcommitted
test: do not force the process to exit
Using `process.exit()` in these tests is unnecessary and may mask other problems. Refs: #29873 (review) PR-URL: #29923 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Anto Aravinth <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]>
1 parent 44c581e commit 50f0660

8 files changed

+6
-10
lines changed

test/parallel/test-cluster-net-send.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ if (process.argv[2] !== 'child') {
7272
});
7373

7474
process.on('disconnect', function() {
75-
process.exit();
7675
server.close();
7776
});
7877
}

test/parallel/test-http-date-header.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ server.addListener('listening', () => {
4848
'Response headers didn\'t contain a Date.');
4949
res.addListener('end', () => {
5050
server.close();
51-
process.exit();
5251
});
5352
res.resume();
5453
});

test/parallel/test-http-expect-continue.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ server.on('listening', common.mustCall(() => {
7676
assert.strictEqual(body, test_res_body);
7777
assert.ok('abcd' in res.headers, 'Response headers missing.');
7878
server.close();
79-
process.exit();
8079
}));
8180
}));
8281
}));

test/parallel/test-http-localaddress.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ server.listen(0, '127.0.0.1', () => {
4949
const req = http.request(options, function(res) {
5050
res.on('end', () => {
5151
server.close();
52-
process.exit();
5352
});
5453
res.resume();
5554
});

test/parallel/test-http-set-trailers.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ server.on('listening', function() {
6161
outstanding_reqs--;
6262
if (outstanding_reqs === 0) {
6363
server.close();
64-
process.exit();
6564
}
6665
});
6766
});
@@ -91,7 +90,6 @@ server.on('listening', function() {
9190
);
9291
if (outstanding_reqs === 0) {
9392
server.close();
94-
process.exit();
9593
}
9694
}
9795
});
@@ -110,7 +108,6 @@ server.on('listening', function() {
110108
outstanding_reqs--;
111109
if (outstanding_reqs === 0) {
112110
server.close();
113-
process.exit();
114111
}
115112
});
116113
res.resume();

test/parallel/test-https-localaddress.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ server.listen(0, '127.0.0.1', function() {
6161
const req = https.request(options, function(res) {
6262
res.on('end', function() {
6363
server.close();
64-
process.exit();
6564
});
6665
res.resume();
6766
});

test/parallel/test-https-timeout.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,15 @@ const server = https.createServer(options, function() {
5151
console.log('got response');
5252
});
5353

54+
req.on('error', common.expectsError({
55+
message: 'socket hang up',
56+
code: 'ECONNRESET',
57+
type: Error
58+
}));
59+
5460
req.on('timeout', common.mustCall(function() {
5561
console.log('timeout occurred outside');
5662
req.destroy();
5763
server.close();
58-
process.exit(0);
5964
}));
6065
}));

test/parallel/test-timers-non-integer-delay.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ let N = 50;
4545
const interval = setInterval(common.mustCall(() => {
4646
if (--N === 0) {
4747
clearInterval(interval);
48-
process.exit(0);
4948
}
5049
}, N), TIMEOUT_DELAY);
5150

0 commit comments

Comments
 (0)