Skip to content

Commit a094a81

Browse files
test: ensure that test priority is not higher than current priority
PR-URL: nodejs#55739 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
1 parent 765f16c commit a094a81

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/parallel/test-os.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,12 @@ assert.ok(hostname.length > 0);
8383

8484
// IBMi process priority is different.
8585
if (!common.isIBMi) {
86-
const DUMMY_PRIORITY = 10;
87-
os.setPriority(DUMMY_PRIORITY);
86+
const { PRIORITY_BELOW_NORMAL, PRIORITY_LOW } = os.constants.priority;
87+
const LOWER_PRIORITY = os.getPriority() > PRIORITY_BELOW_NORMAL ? PRIORITY_BELOW_NORMAL : PRIORITY_LOW;
88+
os.setPriority(LOWER_PRIORITY);
8889
const priority = os.getPriority();
8990
is.number(priority);
90-
assert.strictEqual(priority, DUMMY_PRIORITY);
91+
assert.strictEqual(priority, LOWER_PRIORITY);
9192
}
9293

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

0 commit comments

Comments
 (0)