Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8316540

StoreReproducibilityTest fails on some locales

XMLWordPrintable

    • b17

        It was discovered that java/util/Properties/StoreReproducibilityTest fails on some locales (Europe/Dublin), see:
        https://github.com/adoptium/aqa-tests/issues/4751

        Stack Trace:
        java.lang.RuntimeException: Expected date comment Tue Sep 05 00:03:43 IST 2023 to be after Tue Sep 05 00:03:42 IST 2023 but was Mon Sep 04 19:33:43 IST 2023
           at StoreReproducibilityTest.assertCurrentDate(StoreReproducibilityTest.java:434)
           at StoreReproducibilityTest.testEmptySysPropValue(StoreReproducibilityTest.java:256)
           at StoreReproducibilityTest.main(StoreReproducibilityTest.java:71)
           at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
           at java.base/java.lang.reflect.Method.invoke(Method.java:580)
           at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:333)
           at java.base/java.lang.Thread.run(Thread.java:1583)

        Details:
        Problem was tracked down to ambiguous time zone abbreviations. For Europe/Dublin timezone, Date.toString (used by Properties.store) specifies timezone as IST ("Irish Summer Time"), but IST is decoded by FORMATER (in test) as "India Standard Time" resulting in unexpected date and test failure.

        I have found mention of this issue in DateTimeFormatterBuilder class:
        ... Many textual zone names are not unique, such as CST can be for both "Central Standard Time" and "China Standard Time". In this situation, the zone id will be determined by the region information from formatter's locale and the standard zone id for that area, ...

        However FORMATER (used in this test to parse date string) has to use ROOT locale (see: JDK-8282023).

        Possible workarounds would be ether to avoid ambiguous time zone abbreviations by explicitly setting timezone in test. Or skipping check which compares dates.

              naoto Naoto Sato
              zzambers Zdenek Zambersky
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: