Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5b012f5

Browse filesBrowse files
lpincatargos
authored andcommitted
test: move test-http-max-sockets to parallel
PR-URL: #54977 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
1 parent 22b4139 commit 5b012f5
Copy full SHA for 5b012f5

File tree

Expand file treeCollapse file tree

1 file changed

+5
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-4
lines changed
Open diff view settings
Collapse file
+5-4Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
// USE OR OTHER DEALINGS IN THE SOFTWARE.
2121

2222
'use strict';
23-
const common = require('../common');
23+
require('../common');
2424

2525
// Make sure http server doesn't wait for socket pool to establish connections
2626
// https://github.com/nodejs/node-v0.x-archive/issues/877
@@ -40,13 +40,14 @@ const server = http.createServer(function(req, res) {
4040
res.end('Hello World\n');
4141
});
4242

43-
const addrString = agent.getName({ host: '127.0.0.1', port: common.PORT });
43+
server.listen(0, '127.0.0.1', function() {
44+
const { port } = server.address();
45+
const addrString = agent.getName({ host: '127.0.0.1', port });
4446

45-
server.listen(common.PORT, '127.0.0.1', function() {
4647
for (let i = 0; i < N; i++) {
4748
const options = {
4849
host: '127.0.0.1',
49-
port: common.PORT
50+
port
5051
};
5152

5253
const req = http.get(options, function(res) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.