Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: skip setPriority test if insufficient permissions #55863

Closed
wants to merge 1 commit into from

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Nov 15, 2024

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Nov 15, 2024
@LiviaMedeiros
Copy link
Contributor

I'm not sure this is correct approach.

According to NixOS/nixpkgs#355919 (comment), the issue in NixOS happened without having a094a81? In this case, it would make sense to try cherry-picking a094a81 itself because it fixes EACCES (assuming niceness there works the same way as in Linux, and assuming it happened because the niceness in build system was set lower than 10; otherwise it looks like a bug to me).

Copy link

codecov bot commented Nov 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.41%. Comparing base (d9540b5) to head (f60cc58).
Report is 39 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #55863      +/-   ##
==========================================
- Coverage   88.41%   88.41%   -0.01%     
==========================================
  Files         654      654              
  Lines      187811   187852      +41     
  Branches    36134    36130       -4     
==========================================
+ Hits       166059   166092      +33     
- Misses      14992    15002      +10     
+ Partials     6760     6758       -2     

see 27 files with indirect coverage changes

---- 🚨 Try these New Features:

Copy link

@JohnRTitor JohnRTitor left a comment

Choose a reason for hiding this comment

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

Works on NixOS

@aduh95 aduh95 added the request-ci Add this label to start a Jenkins CI on a PR. label Nov 15, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 15, 2024
@nodejs-github-bot
Copy link
Collaborator

@aduh95
Copy link
Contributor Author

aduh95 commented Nov 17, 2024

@nodejs/fs can I get some reviews please?

Copy link
Contributor

@LiviaMedeiros LiviaMedeiros left a comment

Choose a reason for hiding this comment

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

Not blocking it as-is, since there are platforms that do not allow setting lower priority (which is IMHO a bug, i don't see why it should be restricted intentionally), and assuming unbreaking their build being urgent.
But if we ignore EACCES, it's better to remove this part of test completely, because it's already covered by test-os-process-priority.js.

Comment on lines 85 to 87
if (!common.isIBMi) {
const { PRIORITY_BELOW_NORMAL, PRIORITY_LOW } = os.constants.priority;
const LOWER_PRIORITY = os.getPriority() > PRIORITY_BELOW_NORMAL ? PRIORITY_BELOW_NORMAL : PRIORITY_LOW;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (!common.isIBMi) {
const { PRIORITY_BELOW_NORMAL, PRIORITY_LOW } = os.constants.priority;
const LOWER_PRIORITY = os.getPriority() > PRIORITY_BELOW_NORMAL ? PRIORITY_BELOW_NORMAL : PRIORITY_LOW;

Comment on lines +88 to 98
try {
os.setPriority(LOWER_PRIORITY);
const priority = os.getPriority();
is.number(priority);
assert.strictEqual(priority, LOWER_PRIORITY);
} catch (err) {
// The current user might not have sufficient permissions to set this
// specific priority level.
if (err?.info?.code !== 'EACCES') throw err;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
try {
os.setPriority(LOWER_PRIORITY);
const priority = os.getPriority();
is.number(priority);
assert.strictEqual(priority, LOWER_PRIORITY);
} catch (err) {
// The current user might not have sufficient permissions to set this
// specific priority level.
if (err?.info?.code !== 'EACCES') throw err;
}
}

@aduh95
Copy link
Contributor Author

aduh95 commented Nov 20, 2024

Superseded by #55908

@aduh95 aduh95 closed this Nov 20, 2024
@aduh95 aduh95 deleted the test-os-setPriority-EACCES branch November 20, 2024 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build failure: nodePackages_latest.nodejs
6 participants