From 4bd01873eb9d95ebb26afe1c8fd4dbf087c0890b Mon Sep 17 00:00:00 2001 From: cjihrig Date: Mon, 24 Sep 2018 23:18:31 -0400 Subject: [PATCH] test: handle uv_os_setpriority() windows edge case Refs: https://github.com/nodejs/node/pull/22817 Refs: https://github.com/libuv/help/issues/64 PR-URL: https://github.com/libuv/libuv/pull/2002 Reviewed-By: Bartosz Sosnowski --- test/test-process-priority.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/test-process-priority.c b/test/test-process-priority.c index ebee6b90a..b3d0a85bd 100644 --- a/test/test-process-priority.c +++ b/test/test-process-priority.c @@ -54,8 +54,10 @@ TEST_IMPL(process_priority) { #ifndef _WIN32 ASSERT(priority == i); #else + /* On Windows, only elevated users can set UV_PRIORITY_HIGHEST. Other + users will silently be set to UV_PRIORITY_HIGH. */ if (i < UV_PRIORITY_HIGH) - ASSERT(priority == UV_PRIORITY_HIGHEST); + ASSERT(priority == UV_PRIORITY_HIGHEST || priority == UV_PRIORITY_HIGH); else if (i < UV_PRIORITY_ABOVE_NORMAL) ASSERT(priority == UV_PRIORITY_HIGH); else if (i < UV_PRIORITY_NORMAL)