-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Skip "reserved device names as path segments" tests on Win10 #52282
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: @carlossanlop Issue DetailsResolves #20986. Recent versions of Win10 relax the restriction on creating filesystem objects named This PR skips all such tests on Win10, since we shouldn't test behavior which is an OS implementation detail subject to change. The tests still run on Win7 and Win8 to ensure that we're throwing friendly exception messages on those platforms. I also took this opportunity to clean up some of the logic in PlatformDetection.cs. The Windows version checks now mostly filter down to a single helper, except where very specific version checks must take place.
|
| private static extern int GetCurrentApplicationUserModelId(ref uint applicationUserModelIdLength, byte[] applicationUserModelId); | ||
|
|
||
| internal static uint GetWindowsVersion() | ||
| private static volatile Version s_windowsVersionObject; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Volatile to avoid torn write?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, want the object ref to be published after all its fields are set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we just use Lazy for it?
|
Area owners - if there's any other feedback, leave it here (or email me) and we can get a followup PR posted, no problem. |
adamsitnik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GrabYourPitchforks thank you for helping us to get stable tests!
| private static extern int GetCurrentApplicationUserModelId(ref uint applicationUserModelIdLength, byte[] applicationUserModelId); | ||
|
|
||
| internal static uint GetWindowsVersion() | ||
| private static volatile Version s_windowsVersionObject; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we just use Lazy for it?
Resolves #20986.
Recent versions of Win10 relax the restriction on creating filesystem objects named
COM1,LPT1,AUX, and similar. Some of our tests attempt to create these "illegal" filesystem objects and fail, as they're expecting an exception, but the directory is instead created successfully.This PR skips all such tests on Win10, since we shouldn't test behavior which is an OS implementation detail subject to change. The tests still run on Win7 and Win8 to ensure that we're throwing friendly exception messages on those platforms.
I also took this opportunity to clean up some of the logic in PlatformDetection.cs. The Windows version checks now mostly filter down to a single helper, except where very specific version checks must take place.
There are no changes to shipping code in this PR. This PR only affects unit tests.