0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-21 13:09:21 +01:00

test: fix determining lower priority

PR-URL: https://github.com/nodejs/node/pull/55908
Fixes: https://github.com/NixOS/nixpkgs/issues/355919
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
Livia Medeiros 2024-11-21 03:25:05 +09:00 committed by GitHub
parent 81f7c769e1
commit f270462c09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -84,7 +84,8 @@ assert.ok(hostname.length > 0);
// IBMi process priority is different.
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;
// Priority means niceness: higher numeric value <=> lower 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);