fix: skip non-writable directory check in TestPreCheckConfig when running as root#12548
fix: skip non-writable directory check in TestPreCheckConfig when running as root#12548
Conversation
|
Hi @Copilot. Thanks for your PR. I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
…ning as root Co-authored-by: wuhuizuo <2574558+wuhuizuo@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
[FORMAT CHECKER NOTIFICATION] Notice: To remove the 📖 For more info, you can check the "Contribute Code" section in the development guide. |
|
/test wip-pull-unit-test-engine wip-pull-unit-test-dm |
|
@Copilot: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What problem does this PR solve?
Issue Number: close #xxx
TestPreCheckConfigwas flaky on CI because the non-writable directory subtest (0o400perms) expectsPreCheckConfigto return an error, but Linux root bypasses DAC permission checks —IsDirReadWritablesucceeds unconditionally as root, causing a spuriousnilerror result.What is changed and how it works?
os.Getuid() != 0guard so it's skipped when the test process runs as root, where the assumption "can't write to a 0o400 dir" simply doesn't hold.Check List
Tests
Questions
Will it cause performance regression or break compatibility?
No.
Do you need to update user documentation, design documentation or monitoring documentation?
No.
Release note
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.