mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
test: enforce exit code in test-http-server-stale-close
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: https://github.com/nodejs/node/pull/65198 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
1 file changed
+8
-4
@@ -35,7 +35,7 @@ if (process.env.NODE_TEST_FORK_PORT) {
|
||||
req.write('BAM');
|
||||
req.end();
|
||||
} else {
|
||||
const server = http.createServer(common.mustCallAtLeast((req, res) => {
|
||||
const server = http.createServer(common.mustCall((req, res) => {
|
||||
res.writeHead(200, { 'Content-Length': '42' });
|
||||
req.pipe(res);
|
||||
assert.strictEqual(req.destroyed, false);
|
||||
@@ -45,9 +45,13 @@ if (process.env.NODE_TEST_FORK_PORT) {
|
||||
res.end();
|
||||
}));
|
||||
}));
|
||||
server.listen(0, function() {
|
||||
fork(__filename, {
|
||||
server.listen(0, common.mustCall(function() {
|
||||
const cp = fork(__filename, {
|
||||
stdio: 'inherit',
|
||||
env: { ...process.env, NODE_TEST_FORK_PORT: this.address().port }
|
||||
});
|
||||
});
|
||||
cp.once('exit', common.mustCall((code) => {
|
||||
assert.strictEqual(code, 0);
|
||||
}));
|
||||
}));
|
||||
}
|
||||
Reference in new issue
Block a user