From 0a2631f92f1c14791adbd6a95da368c54a25e361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Arboleda?= Date: Thu, 2 Oct 2025 21:42:49 -0500 Subject: [PATCH] test: make `thread_priority` robust against system default nice levels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test previously assumed a default nice value of 0, but this can vary depending on PAM configuration, /etc/security/limits.conf, or other environment settings. Fixes: https://github.com/libuv/libuv/issues/4898 Signed-off-by: Juan José Arboleda --- test/test-thread-priority.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/test-thread-priority.c b/test/test-thread-priority.c index f1e4f9a70..acc338551 100644 --- a/test/test-thread-priority.c +++ b/test/test-thread-priority.c @@ -88,8 +88,6 @@ TEST_IMPL(thread_priority) { * test set nice value for the calling thread with default schedule policy */ #ifdef __linux__ - ASSERT_OK(uv_thread_getpriority(pthread_self(), &priority)); - ASSERT_EQ(priority, 0); ASSERT_OK(uv_thread_setpriority(pthread_self(), UV_THREAD_PRIORITY_LOWEST)); ASSERT_OK(uv_thread_getpriority(pthread_self(), &priority)); ASSERT_EQ(priority, (0 - UV_THREAD_PRIORITY_LOWEST * 2)); @@ -108,4 +106,4 @@ TEST_IMPL(thread_priority) { #endif return 0; -} \ No newline at end of file +}