Skip to content

Commit e1f54e2

Browse files
LiviaMedeirosaduh95
authored andcommittedNov 16, 2024
test: ensure that test priority is not higher than current priority
PR-URL: #55739 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 9862912 commit e1f54e2

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)