GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: remove common.PORT from http tests · nodejs/node@b383fdd

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-http-client-keep-alive-release-before-finish.js
    • test-http-no-read-no-dump.js
Expand file treeCollapse file tree
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)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.