diff --git a/test/parallel/test-os.js b/test/parallel/test-os.js index f7059260ce507e..efaec2b3ead385 100644 --- a/test/parallel/test-os.js +++ b/test/parallel/test-os.js @@ -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'