From 7f40deae6fee1534512ce25b25f9b89ec7e96aee Mon Sep 17 00:00:00 2001 From: LiviaMedeiros Date: Tue, 19 Nov 2024 02:06:19 +0800 Subject: [PATCH 1/2] test: fix determining lower priority --- test/parallel/test-os.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-os.js b/test/parallel/test-os.js index efaec2b3ead385..bbc605cb50a1ff 100644 --- a/test/parallel/test-os.js +++ b/test/parallel/test-os.js @@ -84,7 +84,7 @@ 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; + const LOWER_PRIORITY = os.getPriority() < PRIORITY_BELOW_NORMAL ? PRIORITY_BELOW_NORMAL : PRIORITY_LOW; os.setPriority(LOWER_PRIORITY); const priority = os.getPriority(); is.number(priority); From bf80e2b53cbe79733f086de95a40d630de02b470 Mon Sep 17 00:00:00 2001 From: LiviaMedeiros Date: Tue, 19 Nov 2024 17:01:10 +0800 Subject: [PATCH 2/2] squash: add comment --- test/parallel/test-os.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/parallel/test-os.js b/test/parallel/test-os.js index bbc605cb50a1ff..3d9fe5c1a60e2e 100644 --- a/test/parallel/test-os.js +++ b/test/parallel/test-os.js @@ -84,6 +84,7 @@ assert.ok(hostname.length > 0); // IBMi process priority is different. if (!common.isIBMi) { const { PRIORITY_BELOW_NORMAL, PRIORITY_LOW } = os.constants.priority; + // 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();