Skip to content

Test(fs): Fix test_eq_windows_file_type for Windows 7 #141104

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PaulDance
Copy link
Contributor

@PaulDance PaulDance commented May 16, 2025

Would otherwise fail on:

thread 'fs::tests::test_eq_windows_file_type' panicked at library/std/src/test_helpers.rs:53:20:
called `Result::unwrap()` on an `Err` value: Os { code: 5, kind: PermissionDenied, message: "Access is denied." }

This came from the read-only attribute set on the test file. In order to fix this, instead of simply disabling the test, the attribute is reset before the test's end so it may still run successfully.

@rustbot label T-libs A-filesystem A-testsuite O-windows-7 O-windows-msvc

Would otherwise fail on:

```
thread 'fs::tests::test_eq_windows_file_type' panicked at library/std/src/test_helpers.rs:53:20:
called `Result::unwrap()` on an `Err` value: Os { code: 5, kind: PermissionDenied, message: "Access is denied." }
```

This came from the read-only attribute set on the test file. In order to
fix this, instead of simply disabling the test, the attribute is reset
before the test's end so it may still run successfully.

Signed-off-by: Paul Mabileau <paul.mabileau@harfanglab.fr>
@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label May 16, 2025
@PaulDance PaulDance marked this pull request as ready for review May 16, 2025 23:35
@rustbot
Copy link
Collaborator

rustbot commented May 16, 2025

r? @ChrisDenton

rustbot has assigned @ChrisDenton.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. A-filesystem Area: `std::fs` A-testsuite Area: The testsuite used to check the correctness of rustc O-windows-7 OS: Windows 7 or Windows Server 2008 R2 or etc. O-windows-msvc Toolchain: MSVC, Operating system: Windows labels May 16, 2025
@PaulDance PaulDance changed the title Test(fs): Fix test_eq_windows_file_type for Windows 7 Test(fs): Fix test_eq_windows_file_type for Windows 7 May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-filesystem Area: `std::fs` A-testsuite Area: The testsuite used to check the correctness of rustc O-windows-7 OS: Windows 7 or Windows Server 2008 R2 or etc. O-windows-msvc Toolchain: MSVC, Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants