diff options
-rw-r--r-- | doc/api/os.md | 3 | ||||
-rw-r--r-- | test/parallel/test-os-process-priority.js | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/doc/api/os.md b/doc/api/os.md index a0ff5e7ff1..ad5736d769 100644 --- a/doc/api/os.md +++ b/doc/api/os.md @@ -371,6 +371,9 @@ priority classes, `priority` is mapped to one of six priority constants in mapping may cause the return value to be slightly different on Windows. To avoid confusion, it is recommended to set `priority` to one of the priority constants. +On Windows setting priority to `PRIORITY_HIGHEST` requires elevated user, +otherwise the set priority will be silently reduced to `PRIORITY_HIGH`. + ## os.tmpdir() <!-- YAML added: v0.9.9 diff --git a/test/parallel/test-os-process-priority.js b/test/parallel/test-os-process-priority.js index 9d66cfc49b..05686e6c77 100644 --- a/test/parallel/test-os-process-priority.js +++ b/test/parallel/test-os-process-priority.js @@ -116,8 +116,10 @@ function checkPriority(pid, expected) { return; } + // On Windows setting PRIORITY_HIGHEST will only work for elevated user, + // for others it will be silently reduced to PRIORITY_HIGH if (expected < PRIORITY_HIGH) - assert.strictEqual(priority, PRIORITY_HIGHEST); + assert.ok(priority === PRIORITY_HIGHEST || priority === PRIORITY_HIGH); else if (expected < PRIORITY_ABOVE_NORMAL) assert.strictEqual(priority, PRIORITY_HIGH); else if (expected < PRIORITY_NORMAL) |