-
Notifications
You must be signed in to change notification settings - Fork 991
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
Some tests depend on machine specifics #3121
Comments
I would emphasise getting tests passing on ANY machine over specific VMs as it reduces the contribution burden |
There are a lot of global knobs to turn in Windows, I would not expect tests to accomodate for all of them. Some things may even be impossible to test on some machines. Like theming may be turned off globally, it'd be hard to get those tests running sucessfully, the best you can do is to detect this and skip them. You might also get a lot of failures if you use high contrast themes globally (didn't test but its something which changes a lot of measurements). Neither of these happened to me, just saying this is a bottomless hole to dig into :-) |
This comment has been minimized.
This comment has been minimized.
Reopening since we still have few tests that appear to be machine specific:
|
On first glance both failures seem to be related to culture, which was not subject of the fixes here (have a separate issue for that).
First day of week is a machine wide culture setting, expected value should either come from CultureInfo or the test should run with the default en-US culture without user customizations.
The |
So what did SendMessage actually return? Interop code uses Maybe this test failure detected an actual mismatch between the locale MonthCalendar uses and the CurrentCulture locale? Could be an actual bug, so lets not be hasty considering the exceptions incorrect. (Note the +6 mod 7 in the test code is to correct the misalignment between |
This comment has been minimized.
This comment has been minimized.
Definitely wrong, the docs of I think the key here is figuring out why your locale and CurrentCulture differ, might be a bug in the .NET Core runtime? Maybe check with Desktop Framework if it differs there as well? Normally (on Desktop Framework) CurrentCulture has the Windows locale settings applied over it (it doesn't roundtrip, if you were to ask for |
I tested further, I changed my Windows' first day of the week to be "Saturday". winforms/src/System.Windows.Forms/src/System/Windows/Forms/Day.cs Lines 37 to 40 in 100762a
So I can infer two things here:
@tarekgh @safern do you think you could demystify the purpose of |
This comment has been minimized.
This comment has been minimized.
We have a bug in .NET 5.0 which currently @safern working on fixing it. dotnet/runtime#37121 |
Some more locale-specific tests
|
I think this issue has resolved. I'm no longer getting any locale specific failures. |
.NET Core Version:
5.0 master branch
Have you experienced this same bug with .NET Framework?:
not applicable
Problem description:
After removing culture-specific test failures (tracked by #2734) there are a few more tests failing for me which I believe happen due to relying on machine specific conditions.
list of failed tests
There is a compromise to make between developer convenience and how exactly you require tests matching their OS environment, if they are too strict developers can run tests only in a VM.
So far I could identify:
I'll put together a PR, so you can then decide which of the changes are reasonable enough to take.
Expected behavior:
Tests are (within reason) coded to be independent of machine characteristics.
Minimal repro:
Having either of these characteristics will fail some tests:
The text was updated successfully, but these errors were encountered: