Skip to content

Commit

Permalink
test: ensure that test priority is not higher than current priority
Browse files Browse the repository at this point in the history
PR-URL: #55739
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
  • Loading branch information
LiviaMedeiros authored and aduh95 committed Nov 16, 2024
1 parent 9862912 commit e1f54e2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/parallel/test-os.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,12 @@ assert.ok(hostname.length > 0);

// IBMi process priority is different.
if (!common.isIBMi) {
const DUMMY_PRIORITY = 10;
os.setPriority(DUMMY_PRIORITY);
const { PRIORITY_BELOW_NORMAL, PRIORITY_LOW } = os.constants.priority;
const LOWER_PRIORITY = os.getPriority() > PRIORITY_BELOW_NORMAL ? PRIORITY_BELOW_NORMAL : PRIORITY_LOW;
os.setPriority(LOWER_PRIORITY);
const priority = os.getPriority();
is.number(priority);
assert.strictEqual(priority, DUMMY_PRIORITY);
assert.strictEqual(priority, LOWER_PRIORITY);
}

// On IBMi, os.uptime() returns 'undefined'
Expand Down

0 comments on commit e1f54e2

Please sign in to comment.