-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
[libc] Fix scheduler test incorrectly guessing user privileges #95562
Merged
jhuber6
merged 3 commits into
llvm:main
from
overmighty:libc-disable-sched-tests-failing-on-arch
Jun 20, 2024
Merged
[libc] Fix scheduler test incorrectly guessing user privileges #95562
jhuber6
merged 3 commits into
llvm:main
from
overmighty:libc-disable-sched-tests-failing-on-arch
Jun 20, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These tests fail on Arch Linux, where setting these scheduling policies succeeds even when not running as root.
@llvm/pr-subscribers-libc Author: OverMighty (overmighty) ChangesThese tests fail on Arch Linux, where setting these scheduling policies Full diff: https://github.com/llvm/llvm-project/pull/95562.diff 1 Files Affected:
diff --git a/libc/test/src/sched/param_and_scheduler_test.cpp b/libc/test/src/sched/param_and_scheduler_test.cpp
index 8e81f2ed1517f..7cf553f1af525 100644
--- a/libc/test/src/sched/param_and_scheduler_test.cpp
+++ b/libc/test/src/sched/param_and_scheduler_test.cpp
@@ -145,9 +145,11 @@ class SchedTest : public LIBC_NAMESPACE::testing::Test {
using LlvmLibcSchedTest = SchedTest; \
TEST_F(LlvmLibcSchedTest, Sched_##policy) { testSched(policy, can_set); }
-// Root is required to set these policies.
-LIST_SCHED_TESTS(SCHED_FIFO, LIBC_NAMESPACE::getuid() == 0)
-LIST_SCHED_TESTS(SCHED_RR, LIBC_NAMESPACE::getuid() == 0)
+// Temporarily disabled as these tests are failing on Arch Linux where
+// scheduling policy setting succeeds without running as root.
+// // Root is required to set these policies.
+// LIST_SCHED_TESTS(SCHED_FIFO, LIBC_NAMESPACE::getuid() == 0)
+// LIST_SCHED_TESTS(SCHED_RR, LIBC_NAMESPACE::getuid() == 0)
// No root is required to set these policies.
LIST_SCHED_TESTS(SCHED_OTHER, true)
|
michaelrj-google
approved these changes
Jun 14, 2024
This reverts commit 3821052.
Non-root users may be able to set real-time scheduling policies. Don't expect failure to set real-time scheduling policies based on UID. Instead, check that if it fails, it is either due to missing privileges, or unsupported parameters if the scheduling policy is not mandated by POSIX.
SchrodingerZhu
approved these changes
Jun 17, 2024
I don't have write access to the repo, could someone merge this for me please? |
AlexisPerry
pushed a commit
to llvm-project-tlp/llvm-project
that referenced
this pull request
Jul 9, 2024
…95562) Non-root users may be able to set real-time scheduling policies. Don't expect failure to set real-time scheduling policies based on UID. Instead, check that if it fails, it is either due to missing privileges, or unsupported parameters if the scheduling policy is not mandated by POSIX. Fixes llvm#95564.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Non-root users may be able to set real-time scheduling policies. Don't
expect failure to set real-time scheduling policies based on UID.
Instead, check that if it fails, it is either due to missing privileges,
or unsupported parameters if the scheduling policy is not mandated by
POSIX.
Fixes #95564.