summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLuigi Pinca <luigipinca@gmail.com>2019-10-10 21:30:12 +0200
committerRich Trott <rtrott@gmail.com>2019-10-12 17:08:43 -0700
commit19a8d22c77f55858d8dfb1fa593837112fb4aad2 (patch)
treeb6416f3808dae9258eb6ed58db7064d6d1604ada /test
parent02b3722b30f9219491587376abb11c1489e512c7 (diff)
downloadandroid-node-v8-19a8d22c77f55858d8dfb1fa593837112fb4aad2.tar.gz
android-node-v8-19a8d22c77f55858d8dfb1fa593837112fb4aad2.tar.bz2
android-node-v8-19a8d22c77f55858d8dfb1fa593837112fb4aad2.zip
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>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-cluster-net-send.js1
-rw-r--r--test/parallel/test-http-date-header.js1
-rw-r--r--test/parallel/test-http-expect-continue.js1
-rw-r--r--test/parallel/test-http-localaddress.js1
-rw-r--r--test/parallel/test-http-set-trailers.js3
-rw-r--r--test/parallel/test-https-localaddress.js1
-rw-r--r--test/parallel/test-https-timeout.js7
-rw-r--r--test/parallel/test-timers-non-integer-delay.js1
8 files changed, 6 insertions, 10 deletions
diff --git a/test/parallel/test-cluster-net-send.js b/test/parallel/test-cluster-net-send.js
index 14ce58474f..9e0ad6b3be 100644
--- a/test/parallel/test-cluster-net-send.js
+++ b/test/parallel/test-cluster-net-send.js
@@ -72,7 +72,6 @@ if (process.argv[2] !== 'child') {
});
process.on('disconnect', function() {
- process.exit();
server.close();
});
}
diff --git a/test/parallel/test-http-date-header.js b/test/parallel/test-http-date-header.js
index b389e33664..169af2bf2a 100644
--- a/test/parallel/test-http-date-header.js
+++ b/test/parallel/test-http-date-header.js
@@ -48,7 +48,6 @@ server.addListener('listening', () => {
'Response headers didn\'t contain a Date.');
res.addListener('end', () => {
server.close();
- process.exit();
});
res.resume();
});
diff --git a/test/parallel/test-http-expect-continue.js b/test/parallel/test-http-expect-continue.js
index 10bcb9d568..9d24a9278d 100644
--- a/test/parallel/test-http-expect-continue.js
+++ b/test/parallel/test-http-expect-continue.js
@@ -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();
}));
}));
}));
diff --git a/test/parallel/test-http-localaddress.js b/test/parallel/test-http-localaddress.js
index 47af784e9a..e237c3bff1 100644
--- a/test/parallel/test-http-localaddress.js
+++ b/test/parallel/test-http-localaddress.js
@@ -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();
});
diff --git a/test/parallel/test-http-set-trailers.js b/test/parallel/test-http-set-trailers.js
index 9068ef8f76..921c456bda 100644
--- a/test/parallel/test-http-set-trailers.js
+++ b/test/parallel/test-http-set-trailers.js
@@ -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();
diff --git a/test/parallel/test-https-localaddress.js b/test/parallel/test-https-localaddress.js
index 6c6cac37cc..0ac8414b2d 100644
--- a/test/parallel/test-https-localaddress.js
+++ b/test/parallel/test-https-localaddress.js
@@ -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();
});
diff --git a/test/parallel/test-https-timeout.js b/test/parallel/test-https-timeout.js
index 9ba621e436..6955ef0af1 100644
--- a/test/parallel/test-https-timeout.js
+++ b/test/parallel/test-https-timeout.js
@@ -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);
}));
}));
diff --git a/test/parallel/test-timers-non-integer-delay.js b/test/parallel/test-timers-non-integer-delay.js
index 15b405e9a4..eabfc56026 100644
--- a/test/parallel/test-timers-non-integer-delay.js
+++ b/test/parallel/test-timers-non-integer-delay.js
@@ -45,7 +45,6 @@ let N = 50;
const interval = setInterval(common.mustCall(() => {
if (--N === 0) {
clearInterval(interval);
- process.exit(0);
}
}, N), TIMEOUT_DELAY);