Skip to content

test: add fix so that test exits if port 42 is unprivileged - #45904

Merged
nodejs-github-bot merged 6 commits into
nodejs:mainfrom
7suyash7:test
Jan 18, 2023
Merged

test: add fix so that test exits if port 42 is unprivileged#45904
nodejs-github-bot merged 6 commits into
nodejs:mainfrom
7suyash7:test

Conversation

@7suyash7

Copy link
Copy Markdown
Contributor

fixes: #45838

@nodejs-github-botnodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Dec 18, 2022
@bnoordhuis

Copy link
Copy Markdown
Member

The way the test is written now makes it possible for future regressions to go undetected so that's no good, unfortunately.

I'd simply call out to sysctl(1) with execSync() to check the value. There's at least one other instance of that in our test suite so it's not without precedent.

@7suyash7

Copy link
Copy Markdown
ContributorAuthor

Okay, I'll make these changes

@7suyash7

Copy link
Copy Markdown
ContributorAuthor

@bnoordhuis is this fine?

Comment threadtest/parallel/test-cluster-bind-privileged-port.js Outdated
Comment threadtest/parallel/test-cluster-bind-privileged-port.js Outdated
Comment threadtest/parallel/test-cluster-bind-privileged-port.js
@7suyash7

Copy link
Copy Markdown
ContributorAuthor

added these changes @bnoordhuis

@7suyash7

Copy link
Copy Markdown
ContributorAuthor

Can you try merging again? Had some lint errors, hopefully, they are fixed now. @bnoordhuis

Comment threadtest/parallel/test-cluster-bind-privileged-port.js Outdated
Comment threadtest/parallel/test-cluster-bind-privileged-port.js Outdated
Comment threadtest/parallel/test-cluster-bind-privileged-port.js Outdated
Comment threadtest/parallel/test-cluster-bind-privileged-port.js
@7suyash7

Copy link
Copy Markdown
ContributorAuthor

Can you please take a look?

Comment threadtest/parallel/test-cluster-bind-privileged-port.js Outdated
const { execSync } = require('child_process');

if (common.isLinux) {
const sysctlOutput = execSync('sysctl net.ipv4.ip_unprivileged_port_start').toString();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, should I add one now? (PR is closing to merging I think...)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR is closing to merging I think...

I am not sure what you mean here, you can still push changes and I'll re-run CI after :]

If you prefer to put it in another change to practice making changes in Node.js as a new contributor - that's also fine with me.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like it if I could put it in another change so I can practice making changes, that would be really helpful!

@benjamingrbenjamingr added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 22, 2022
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 22, 2022
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@lpincalpinca added the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label Jan 10, 2023
@lpincalpinca added the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 18, 2023
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 18, 2023
@nodejs-github-bot
nodejs-github-bot merged commit 60cc1ba into nodejs:mainJan 18, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 60cc1ba

RafaelGSS pushed a commit that referenced this pull request Jan 20, 2023
PR-URL: #45904Fixes: #45838
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@RafaelGSSRafaelGSS mentioned this pull request Jan 20, 2023
juanarbol pushed a commit that referenced this pull request Jan 26, 2023
PR-URL: #45904Fixes: #45838
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@juanarboljuanarbol mentioned this pull request Jan 28, 2023
juanarbol pushed a commit that referenced this pull request Jan 31, 2023
PR-URL: #45904Fixes: #45838
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commit-queue-squashAdd this label to instruct the Commit Queue to squash all the PR commits into the first one.needs-ciPRs that need a full CI run.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: check net.ipv4.ip_unprivileged_port_start in parallel/test-cluster-bind-privileged-port

5 participants

@7suyash7@bnoordhuis@nodejs-github-bot@benjamingr@lpinca