0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-21 21:19:50 +01:00
nodejs/test/parallel/test-http-client-close-with-default-agent.js
Luigi Pinca 57ff476c33
test: remove duplicate test
`test/parallel/test-http-agent-no-wait.js` is basically a duplicate of
`test/parallel/test-http-client-close-with-default-agent.js`, remove it.

PR-URL: https://github.com/nodejs/node/pull/44051
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Feng Yu <F3n67u@outlook.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-07-31 12:46:06 +01:00

24 lines
570 B
JavaScript

'use strict';
const common = require('../common');
const assert = require('assert');
const http = require('http');
const server = http.createServer(function(req, res) {
res.writeHead(200);
res.end();
});
server.listen(0, common.mustCall(() => {
const req = http.get({ port: server.address().port }, (res) => {
assert.strictEqual(res.statusCode, 200);
res.resume();
server.close();
});
req.end();
}));
// This timer should never go off as the server will close the socket
setTimeout(common.mustNotCall(), common.platformTimeout(1000)).unref();