Skip to content
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

Japanese calendar test failures locally #25217

Closed
stephentoub opened this issue Feb 27, 2018 · 4 comments
Closed

Japanese calendar test failures locally #25217

stephentoub opened this issue Feb 27, 2018 · 4 comments
Assignees
Labels
area-System.Globalization test-bug Problem in test source code (most likely)
Milestone

Comments

@stephentoub
Copy link
Member

I deterministically get these test failures when I run the tests in the repo locally:

     System.Globalization.Tests.MiscCalendarsTests.JapaneseTest [FAIL]
        Assert.Equal() Failure
        Expected: 2019-01-08T00:00:00.0000000
        Actual:   1989-01-08T00:00:00.0000000
        Stack Trace:
           d:\repos\corefx\src\System.Globalization.Calendars\tests\Misc\MiscCalendars.cs(44,0): at System.Globalization.Tests.MiscCalendarsTests.JapaneseTest()
     System.Globalization.Tests.JapaneseCalendarEras.Eras [FAIL]
        Assert.Equal() Failure
        Expected: Int32[] [4, 3, 2, 1]
        Actual:   Int32[] [5, 4, 3, 2, 1]
        Stack Trace:
           d:\repos\corefx\src\System.Globalization.Calendars\tests\JapaneseCalendar\JapaneseCalendarEras.cs(14,0): at System.Globalization.Tests.JapaneseCalendarEras.Eras()

     System.Globalization.Tests.CalendarHelpers.ToDateTime_Invalid(calendar: JapaneseLunisolarCalendar { AlgorithmType = LunisolarCalendar, Eras = [5, 4, 3], IsReadOnly = False, MaxSupportedDateTime = 2050-01-22T23:59:59.9999999, MinSupportedDateTime =
  1960-01-28T00:00:00.0000000, ... }) [FAIL]
        Assert.Throws() Failure
        Expected: typeof(System.ArgumentOutOfRangeException)
        Actual:   (No exception was thrown)
        Stack Trace:
           d:\repos\corefx\src\System.Globalization.Calendars\tests\CalendarHelpers.cs(347,0): at System.Globalization.Tests.CalendarHelpers.ToDateTime_Invalid(Calendar calendar)
@Clockwork-Muse
Copy link
Contributor

It appears that Microsoft is getting the jump on assigning the era year; the emperor is planning on abdicating next year. I'm not 100% sure when the era year itself will change: whether the new era will start in 2019 or 2020. It was previously seen as starting in 2019...when it was considered to be abdicating in 2018.
There doesn't appear to be an era name set yet, either, which means the parsing tests should be broken as well (no abbreviated name to test the parse against).

I'm unsure whether to consider it a documentation bug that the docs for the Japanese calendar types don't mention the new era, or just leaving it as "there might be more eras in the future" is fine.

@danmoseley
Copy link
Member

@tarekgh there was a conversation about this a couple weeks ago - I guess this means that @stephentoub received a Windows patch?

@krwq
Copy link
Member

krwq commented Feb 28, 2018

Yes, some RS4 and later machines get a placeholder value with new Era in the registry. The tests have hardcoded values and they fail. The simplest workaround for now is to remove following value in the registry:
Key: Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\Calendars\Japanese\Eras
String Value: 2019 05 01

If this starts failing in the CI I will disable the tests or fix - assuming this code got ported correctly from desktop this is a test issue.

If those are the only 3 tests failing I can pick this up sooner than planned.

@tarekgh
Copy link
Member

tarekgh commented Mar 1, 2018

@krwq could you please fix the test as you did in the full framework?

@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 2.1.0 milestone Jan 31, 2020
@dotnet dotnet locked as resolved and limited conversation to collaborators Dec 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Globalization test-bug Problem in test source code (most likely)
Projects
None yet
Development

No branches or pull requests

6 participants