RFR: 8283606: Tests may fail with zh locale on MacOS [v2]

David Holmes dholmes at openjdk.java.net
Mon Mar 28 05:16:47 UTC 2022

On Thu, 24 Mar 2022 17:30:22 GMT, Vikey Chen <duke at openjdk.java.net> wrote:

>> From the test doc of openjdk https://openjdk.java.net/groups/build/doc/testing.html
>>> If your locale is non-US, some tests are likely to fail. To work around this you can set the locale to US. On Unix platforms simply setting LANG="en_US" in the environment before running tests should work. On Windows or MacOS, setting JTREG="VM_OPTIONS=-Duser.language=en -Duser.country=US" helps for most, but not all test cases.
>> However, on MacOS 12.1, running `make test-tier1 JTREG="VM_OPTIONS=-Duser.language=en -Duser.country=US"` command for tier-1 test, some tests still fail, including the following in tier-1.The tests expects output messages in English, but Chinese message are still produced.
>> test/hotspot/jtreg/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java
>> test/langtools/jdk/javadoc/tool/6964914/TestStdDoclet.java
>> test/langtools/jdk/javadoc/tool/6964914/TestUserDoclet.java
>> test/langtools/jdk/javadoc/tool/EnsureNewOldDoclet.java
>> test/langtools/jdk/javadoc/tool/testLocaleOption/TestLocaleOption.java
>> test/langtools/tools/javac/T8132562/ClassPathWithDoubleQuotesTest.java
>> test/langtools/tools/javac/options/smokeTests/OptionSmokeTest.java
>> test/langtools/tools/javac/platform/PlatformProviderTest.java
>> test/langtools/tools/jdeps/MultiReleaseJar.java
> Vikey Chen has updated the pull request incrementally with one additional commit since the last revision:
>   polish

I do not think we should be trying to use JAVA_TOOL_OPTIONS to set "global" test arguments. If setting the locale via -javaoptions does not suffice due to the way tests spawn JVMs without passing on those arguments, then we should deal with the latter on a test-by-test basis IMO. I do not think there can be a single mechanism here that will always work.


PR: https://git.openjdk.java.net/jdk/pull/7924

More information about the compiler-dev mailing list