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

David Holmes dholmes at openjdk.java.net
Mon Mar 28 07:29:41 UTC 2022

On Mon, 28 Mar 2022 07:00:18 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> If a test expects an English output, then it should explicitly say so when spawning a new JVM.

The problem there is knowing when that is the case. For test/hotspot/jtreg/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java the message "Main method not found in class" comes from the launcher and is a localized error string, but there is no way for the test author to know that without digging into the source to check. We have hundreds of tests that check exception messages and they are not affected by this problem as exception messages are not, it seems, localized. So there is a bit of an inconsistency in that regard.

> There's an ideal fix, but I am not sure if we are willing to go there -- instead of hard coding all the expected messages in 
> English, the tests should get the expected output from the localization resources bundles from javac, javadoc, etc.

How? There's no way to name the desired message so that you could ask for it. And you'd still need to know it was a message that was localized.

The current fix seems okay as a patch of the current set of issues, but really there should be some way to avoid being hit by this with future tests IMO.


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

More information about the compiler-dev mailing list