mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
test: do not force the process to exit
Using `process.exit()` in these tests is unnecessary and may mask other problems. Refs: https://github.com/nodejs/node/pull/29873#pullrequestreview-298851847 PR-URL: https://github.com/nodejs/node/pull/29923 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
This commit is contained in:
1 parent
44c581ef0b
commit
50f066087e
8 files changed
+6
-10
No files matched your search
@@ -72,7 +72,6 @@ if (process.argv[2] !== 'child') {
|
||||
});
|
||||
|
||||
process.on('disconnect', function() {
|
||||
process.exit();
|
||||
server.close();
|
||||
});
|
||||
}
|
||||
@@ -48,7 +48,6 @@ server.addListener('listening', () => {
|
||||
'Response headers didn\'t contain a Date.');
|
||||
res.addListener('end', () => {
|
||||
server.close();
|
||||
process.exit();
|
||||
});
|
||||
res.resume();
|
||||
});
|
||||
|
||||
@@ -76,7 +76,6 @@ server.on('listening', common.mustCall(() => {
|
||||
assert.strictEqual(body, test_res_body);
|
||||
assert.ok('abcd' in res.headers, 'Response headers missing.');
|
||||
server.close();
|
||||
process.exit();
|
||||
}));
|
||||
}));
|
||||
}));
|
||||
@@ -49,7 +49,6 @@ server.listen(0, '127.0.0.1', () => {
|
||||
const req = http.request(options, function(res) {
|
||||
res.on('end', () => {
|
||||
server.close();
|
||||
process.exit();
|
||||
});
|
||||
res.resume();
|
||||
});
|
||||
|
||||
@@ -61,7 +61,6 @@ server.on('listening', function() {
|
||||
outstanding_reqs--;
|
||||
if (outstanding_reqs === 0) {
|
||||
server.close();
|
||||
process.exit();
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -91,7 +90,6 @@ server.on('listening', function() {
|
||||
);
|
||||
if (outstanding_reqs === 0) {
|
||||
server.close();
|
||||
process.exit();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -110,7 +108,6 @@ server.on('listening', function() {
|
||||
outstanding_reqs--;
|
||||
if (outstanding_reqs === 0) {
|
||||
server.close();
|
||||
process.exit();
|
||||
}
|
||||
});
|
||||
res.resume();
|
||||
|
||||
@@ -61,7 +61,6 @@ server.listen(0, '127.0.0.1', function() {
|
||||
const req = https.request(options, function(res) {
|
||||
res.on('end', function() {
|
||||
server.close();
|
||||
process.exit();
|
||||
});
|
||||
res.resume();
|
||||
});
|
||||
|
||||
@@ -51,10 +51,15 @@ const server = https.createServer(options, function() {
|
||||
console.log('got response');
|
||||
});
|
||||
|
||||
req.on('error', common.expectsError({
|
||||
message: 'socket hang up',
|
||||
code: 'ECONNRESET',
|
||||
type: Error
|
||||
}));
|
||||
|
||||
req.on('timeout', common.mustCall(function() {
|
||||
console.log('timeout occurred outside');
|
||||
req.destroy();
|
||||
server.close();
|
||||
process.exit(0);
|
||||
}));
|
||||
}));
|
||||
@@ -45,7 +45,6 @@ let N = 50;
|
||||
const interval = setInterval(common.mustCall(() => {
|
||||
if (--N === 0) {
|
||||
clearInterval(interval);
|
||||
process.exit(0);
|
||||
}
|
||||
}, N), TIMEOUT_DELAY);
|
||||
|
||||
|
||||
Reference in new issue
Block a user