-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix unhandled exception during test discovery on macOS #29083
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
|
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
| string osxVersionString = restOfRid.Split('-')[0]; | ||
|
|
||
| // Starting with macOS 12.0 (Monterey), the RID is "osx.12-x64" instead of the "osx.10.14-x64" format used before, so the version won't have a dot in it | ||
| if (!osxVersionString.Contains('.')) |
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.
Instead of relying on the fact that the RID doesn't contain a period in it, could we make the OS parsing resilient to not having a dot? Then this condition would be something like macOSMajorVersion >= 12.
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.
@dsplaisted good point, I switched to using float parsing for the version like we do for Ubuntu.
a529203 to
145c8e8
Compare
|
@akoeplinger I'm not sure float parsing is a good idea here either, since floats can't represent decimals exactly and you might get a result something like 16.0400000000001. I was going to suggest something like |
|
@dsplaisted I tried and |
|
besides that, 10.12 is ancient so we could probably get rid of that specific version check :) |
While debugging dotnet#29029 I noticed that we hit an unhandled exception because later macOS versions don't have an extra dot in the RID version number so the string split failed. Switched to using float parsing for the version like we do for Ubuntu.
145c8e8 to
77c0980
Compare
While debugging #29029 I noticed that we hit an unhandled exception because later macOS versions don't have an extra dot in the RID version number so the string split failed.
Switched to using float parsing for the version like we do for Ubuntu.