On Thu, 24 Mar 2022 14:06:03 GMT, Roger Riggs <rri...@openjdk.org> 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 > > Can you look into why these tests do not fail on other OS's with the same > locale? > There could be some other way that the locale defaults are used by the tests. @RogerRiggs I have tested that on Ubuntu 18.04 with zh locale. the above failed tests can succeed without any setting(LC environment or JTREG arg). The jtreg test runtime seems to set `LC_ALL=C` environment whatever the system `LC_ALL` is. some related example. In terminal typing `java` on ubuntu, the output is obviously system language chinese. then I set `export LC_ALL=C`, type `java` again, the output is english. On mac, setting `export LC_ALL=C` will make chinese characters become `???`. ------------- PR: https://git.openjdk.java.net/jdk/pull/7924