-
Notifications
You must be signed in to change notification settings - Fork 5.3k
fix and re-enable TestCheckChildProcessUserAndGroupIds test #46138
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
Conversation
|
Tagging subscribers to this area: @eiriktsarpalis Issue Detailsfixes #28922
|
|
/azp list |
|
/azp run runtime-libraries-coreclr outerloop-linux |
|
/azp run runtime-libraries-coreclr outerloop-osx |
|
Azure Pipelines successfully started running 1 pipeline(s). |
1 similar comment
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
For OSX outerloop the failing tests are unrelated:
|
|
However, the Mono leg failed for this particular test:
|
|
|
/azp run runtime-libraries-coreclr outerloop-linux |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run runtime-libraries-coreclr outerloop-linux |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run runtime-libraries-coreclr outerloop-osx |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run runtime-libraries-coreclr outerloop-linux |
|
/azp run runtime-libraries-coreclr outerloop-osx |
|
Azure Pipelines successfully started running 1 pipeline(s). |
1 similar comment
|
Azure Pipelines successfully started running 1 pipeline(s). |
… 116 126 to get the current
|
/azp run runtime-libraries-coreclr outerloop-linux |
|
/azp run runtime-libraries-coreclr outerloop-osx |
|
Azure Pipelines successfully started running 1 pipeline(s). |
1 similar comment
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run runtime-libraries-coreclr outerloop-linux |
|
/azp run runtime-libraries-coreclr outerloop-osx |
|
Azure Pipelines successfully started running 1 pipeline(s). |
1 similar comment
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
The test that I wanted to fix has passed (it was failing at the beginning), the current CI failures are not related: |
|
I feel this is move wrong direction. This starts new process and add dependency on finding the right executable. I think that was OK for the test where we control the environment and overhead does not matter. Further more, it can report group the process actually does not have. I'm wondering if that can cause issues does the road. |
fixes #28922
Explanation: This test gets the current user: name, id, and groups:
runtime/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs
Lines 546 to 549 in 721fb97
and starts a process using the given user name:
runtime/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs
Line 557 in 721fb97
It was failing because so far we were using two different ways of getting the user group Ids:
id -G $usernameto get the expected ids (called from parent process)libc.getgroupsto get the actual ids (called from child process started as given user)There are some differences in what
id -Gandlibc.getgroupscan return and I've verified that by just comparing the output without starting any new processes (see #28922 (comment) for details).The solution is to use
id -Gfor getting both the expected and actual ids. The parent process passes the username to the command, the child command passes no username to get it for the current user (the test verifies if the process was started as the given user)