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

Jie Fu jiefu at openjdk.java.net
Sat Sep 25 03:52:00 UTC 2021


On Sat, 25 Sep 2021 03:38:02 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

> > If I test with `JTREG="VM_OPTIONS=-Duser.language=en -Duser.country=US"`, most of the failures would disappear.
> 
> If the failure disappeared if the "user.language=en" is used does not mean that this is not a JDK bug or some other bugs in the tests. What is the reason for the falure?

An important reason is that the expected output doesn't match due to different languages.

 STDERR:
  stdout: [];
  stderr: [??: ?? emptynumbootstrapmethods1 ???? main ??, ?? main ?????:
    public static void main(String[] args) 
 ?? JavaFX ?????????javafx.application.Application
 ]
  exitValue = 1
 
 java.lang.RuntimeException: 'Main method not found in class emptynumbootstrapmethods1' missing from stdout/stderr 
 
        at jdk.test.lib.process.OutputAnalyzer.shouldContain(OutputAnalyzer.java:221)
        at TestEmptyBootstrapMethodsAttr.main(TestEmptyBootstrapMethodsAttr.java:56)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:312)
        at java.base/java.lang.Thread.run(Thread.java:833)
 
 JavaTest Message: Test threw exception: java.lang.RuntimeException
 JavaTest Message: shutting down test
 
 
 TEST RESULT: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: 'Main method not found in class emptynumbootstrapmethods1' missing from stdout/stderr


E.g., Test runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java with the locale:

LANG=en_US.UTF-8 \
LC_ALL=C \

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

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


More information about the compiler-dev mailing list