RFR: 8272358: Some tests may fail when executed with other locales than the US

Jie Fu jiefu at openjdk.java.net
Sat Sep 25 07:41:54 UTC 2021


On Sat, 25 Sep 2021 05:13:56 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

> > There are still 1500+ failures due to non-US locale after this patch.
> > So my question is: does it make sense to fix only 4 of them?
> 
> This error means that your OpenJDK build contains the translation for your locale, and different tools use the resource bundles to translate different outputs. Looks like nobody validates that the translated output is correct for the various cases since the tests fail on non-US translated locales. I guess in the ideal world that tests should be updated to validate the output for each locale, or probably even better they should check that the output is correct for some specific "key" in the resource bundle.
> 
> The current issue is different, it fixes the tests depended on some specific float format and has no dependency on the resource bundles.

I still don't understand why the failures are different.

But the fix doesn't work even with these 4 tests.


* Before this fix: make test TEST="..."

==============================
Test summary
==============================
   TEST                                              TOTAL  PASS  FAIL ERROR
   jtreg:test/langtools/jdk/jshell/ToolBasicTest.java
>>                                                       1     0     1     0 <<
   jtreg:test/langtools/jdk/jshell/ToolSimpleTest.java
>>                                                       1     0     1     0 <<
   jtreg:test/langtools/tools/javac/lambda/lambdaExecution/LambdaTranslationTest1.java
                                                         1     1     0     0
   jtreg:test/langtools/tools/javac/lambda/lambdaExecution/LambdaTranslationTest2.java
                                                         1     1     0     0
==============================
TEST FAILURE



* After this fix: make test TEST="..."

==============================
Test summary
==============================
   TEST                                              TOTAL  PASS  FAIL ERROR
   jtreg:test/langtools/jdk/jshell/ToolBasicTest.java
>>                                                       1     0     1     0 <<
   jtreg:test/langtools/jdk/jshell/ToolSimpleTest.java
>>                                                       1     0     1     0 <<
   jtreg:test/langtools/tools/javac/lambda/lambdaExecution/LambdaTranslationTest1.java
                                                         1     1     0     0
   jtreg:test/langtools/tools/javac/lambda/lambdaExecution/LambdaTranslationTest2.java
                                                         1     1     0     0
==============================
TEST FAILURE


But if I run with make test JTREG="VM_OPTIONS=-Duser.language=en -Duser.country=US" TEST="...", all of them get passed.

-------------

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


More information about the compiler-dev mailing list