-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: test-thread-priority.c fails on Linux #4382
Comments
The test makes the (perhaps somewhat naive) assumption that the main thread is created with a priority of 0. Do you happen to know what scheduling policy and priority were used when you ran the test? The fix is probably quite simple: diff --git a/test/test-thread-priority.c b/test/test-thread-priority.c
index 0aaf2977..769b485e 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)); |
I don't know how to do this. Where should I look while tests are running? I've applied the diff and it fails with the following:
|
That -13 error suggests it's a permission error. Can you run |
Hi, sorry for the late reply. Directory named |
No, that's okay. As long as you can strace the test. |
This affects Debian as well, see: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1071194#10 I agree that the assumption about |
Gentoo is also patching this line out: https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-libs/libuv/files/libuv-1.48.0-test-thread-priority-portage.patch So, I would suggest removing these two asserts as making assumptions about the build environment is not really good idea. |
ok, I'll patch this out from Debian package. Thanks for the help |
If the |
We're not there yet. I've patched out the lines:
Test on hppa, loong64, powerpc, ppc64, sparc64 and x32 fail on the line after:
See detailed logs in https://buildd.debian.org/status/package.php?p=libuv1 |
-13 is EACCES and suggests the setpriority(2) system call refuses to change the process's nice value. My guess is debian buildbots run thing at low niceness (would make sense for a batch system) and that's what's tripping up the test. If you can strace the test, it should be very easy confirm; you can trace the test with:
I suppose libuv has a bug in that it sets niceness from -4 to +4 but the full range is -20 to +19. |
Unfortunately, I cannot reproduce this problem on Debian ppc64 machines, so I cannot strace it. |
On Jun 25, 2024, at 6:09 PM, Dominique Dumont ***@***.***> wrote:
Unfortunately, I cannot reproduce this problem on Debian ppc64 machines, so I cannot strace it.
Did you remember to set the nice value accordingly?
|
Oops, I did not. Here the strace output:
|
This is not longer failing.
uname -a
Linux ramanujan 6.12.4-arch1-1 #1 SMP PREEMPT_DYNAMIC Mon, 09 Dec 2024 14:31:57 +0000 x86_64 GNU/Linux Should this kept opened? |
Did you run it under a low niceness/chrt setting? |
I'd move to close. If a system is configured in such a way our test suite fails it doesn't necessarily mean we need to change something. The test makes a reasonable assumption about the default priority... |
Oh, I missed @dod38fr's reply... unfortunately, it's a trace of the test runner, not the test itself (that's why you have to specify
I don't know if I'd call it "reasonable", more "works okay most of the time". I'd at least remove or change that |
Hi, assertion fails at
ASSERT_EQ(priority, 0)
in the following:make check output:
The text was updated successfully, but these errors were encountered: