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 dce4947

Browse filesBrowse files
addaleaxtargos
authored andcommitted
test: do not use fixed port in async-hooks/test-httparser-reuse
Otherwise this was failing on machines which already had a service running on port 3000. PR-URL: #28312 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 21d2bdd commit dce4947
Copy full SHA for dce4947

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+3
-4
lines changed
Open diff view settings
Collapse file

‎test/async-hooks/test-httparser-reuse.js‎

Copy file name to clipboardExpand all lines: test/async-hooks/test-httparser-reuse.js
+3-4Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,9 @@ const server = http.createServer((req, res) => {
4747
res.end();
4848
});
4949

50-
const PORT = 3000;
51-
const url = `http://127.0.0.1:${PORT}`;
52-
53-
server.listen(PORT, common.mustCall(() => {
50+
server.listen(0, common.mustCall(() => {
51+
const PORT = server.address().port;
52+
const url = `http://127.0.0.1:${PORT}`;
5453
http.get(url, common.mustCall(() => {
5554
server.close(common.mustCall(() => {
5655
server.listen(PORT, common.mustCall(() => {

0 commit comments

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