Skip to content

Skip testCreateParentDirectories_noPermission when running as root#8260

Open
mvanhorn wants to merge 1 commit intogoogle:masterfrom
mvanhorn:osc/7328-skip-test-root
Open

Skip testCreateParentDirectories_noPermission when running as root#8260
mvanhorn wants to merge 1 commit intogoogle:masterfrom
mvanhorn:osc/7328-skip-test-root

Conversation

@mvanhorn
Copy link

Fixes #7328

MoreFilesTest.testCreateParentDirectories_noPermission expects MoreFiles.createParentDirectories to throw IOException when the parent directory cannot be created due to permissions. However, when running as root, filesystem permission checks are bypassed, so the operation succeeds and the test fails.

This PR adds a root user check that skips the test, matching the existing pattern used for Windows.

This contribution was developed with AI assistance (Claude Code).

When running tests as root, filesystem permission checks are bypassed,
so MoreFiles.createParentDirectories succeeds instead of throwing
IOException. Skip the test in this case, similar to the existing
Windows skip.

Fixes google#7328
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Linux] test failed when using USER root

1 participant