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 8273824

Browse filesBrowse files
TrottMyles Borins
authored andcommitted
test: remove common.PORT from http tests
PR-URL: #7467 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 066cefb commit 8273824
Copy full SHA for 8273824

File tree

Expand file treeCollapse file tree

2 files changed

+14
-10
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+14
-10
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-http-client-keep-alive-release-before-finish.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-client-keep-alive-release-before-finish.js
+7-5Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@ const http = require('http');
44

55
const server = http.createServer((req, res) => {
66
res.end();
7-
}).listen(common.PORT, common.mustCall(() => {
7+
}).listen(0, common.mustCall(() => {
88
const agent = new http.Agent({
99
maxSockets: 1,
1010
keepAlive: true
1111
});
1212

13+
const port = server.address().port;
14+
1315
const post = http.request({
14-
agent: agent,
16+
agent,
1517
method: 'POST',
16-
port: common.PORT,
18+
port,
1719
}, common.mustCall((res) => {
1820
res.resume();
1921
}));
@@ -28,9 +30,9 @@ const server = http.createServer((req, res) => {
2830
}, 100);
2931

3032
http.request({
31-
agent: agent,
33+
agent,
3234
method: 'GET',
33-
port: common.PORT,
35+
port,
3436
}, common.mustCall((res) => {
3537
server.close();
3638
res.connection.end();
Collapse file

‎test/parallel/test-http-no-read-no-dump.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-no-read-no-dump.js
+7-5Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,18 @@ const server = http.createServer((req, res) => {
1515
res.end();
1616
onPause();
1717
});
18-
}).listen(common.PORT, common.mustCall(() => {
18+
}).listen(0, common.mustCall(() => {
1919
const agent = new http.Agent({
2020
maxSockets: 1,
2121
keepAlive: true
2222
});
2323

24+
const port = server.address().port;
25+
2426
const post = http.request({
25-
agent: agent,
27+
agent,
2628
method: 'POST',
27-
port: common.PORT,
29+
port,
2830
}, common.mustCall((res) => {
2931
res.resume();
3032

@@ -41,9 +43,9 @@ const server = http.createServer((req, res) => {
4143
post.write('initial');
4244

4345
http.request({
44-
agent: agent,
46+
agent,
4547
method: 'GET',
46-
port: common.PORT,
48+
port,
4749
}, common.mustCall((res) => {
4850
server.close();
4951
res.connection.end();

0 commit comments

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