Skip to content

Commit aeac6d9

Browse files
Rollup merge of #156562 - lms0806:issue_156558, r=Mark-Simulacrum
Resolving Windows environment test failures This resolves an issue where the `fs::tests::test_fs_set_times follows symlink` and `fs::tests::test_fs_set_times_nofollow` tests failed locally due to permission issues in a Windows environment. The code has been modified so that these tests do not proceed if permissions are not granted. Since these tests can be passed with the necessary permissions via CI before merging, I believe it is appropriate for them to pass locally due to permission issues rather than fail. Close #156558
2 parents 2bef860 + 586d87a commit aeac6d9

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

library/std/src/fs/tests.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2363,6 +2363,9 @@ fn test_fs_set_times_follows_symlink() {
23632363
use crate::os::windows::fs::FileTimesExt;
23642364

23652365
let tmp = tmpdir();
2366+
if !got_symlink_permission(&tmp) {
2367+
return;
2368+
}
23662369

23672370
// Create a target file
23682371
let target = tmp.join("target");
@@ -2461,6 +2464,9 @@ fn test_fs_set_times_nofollow() {
24612464
use crate::os::windows::fs::FileTimesExt;
24622465

24632466
let tmp = tmpdir();
2467+
if !got_symlink_permission(&tmp) {
2468+
return;
2469+
}
24642470

24652471
// Create a target file and a symlink to it
24662472
let target = tmp.join("target");

0 commit comments

Comments
 (0)