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

Ioi Lam iklam at openjdk.java.net
Thu Mar 24 20:08:44 UTC 2022


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

>> I have run tier-1 test with  `JTREG="VM_OPTIONS=-Duser.language=en -Duser.country=US"`, some tests still fail because of default locale, Most of them are langtools tests. 
>> 
>> On MacOS 12.1.
>
> Vikey Chen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   polish

Can you try if this works for you (without your patch)?


export JAVA_TOOL_OPTIONS='-Xlog:gc -Duser.language=en -Duser.country=US' 
make test-only \
    TEST=test/langtools/jdk/javadoc/tool/6964914/TestStdDoclet.java \
    JTREG_OPTIONS=-e:JAVA_TOOL_OPTIONS

make test-only \
    TEST=open/test/langtools/jdk/javadoc/tool/testLocaleOption/TestLocaleOption.java\
    JTREG_OPTIONS=-e:JAVA_TOOL_OPTIONS


The `-Xlog:gc` is just for validating that the options are passed to tools such as `javac` and `javadoc` without the need to add the `-J` prefix. You should see something like this:


Options: [-J--patch-module=jdk.javadoc=patch, -J-Duser.language=en, -J-Duser.country=GB, -J-Duser.variant=ALLCAPS, -sourcepath, src, -d, testHelloWorldDefault_ALLCAPS/api, p]
[STDOUT]:
[0.022s][info][gc] Using G1
[0.681s][info][gc] GC(0) Pause Young (Normal) (G1 Evacuation Pause) 8M->3M(16M) 9.021ms
....
[STDERR]:
Picked up JAVA_TOOL_OPTIONS: -Xlog:gc -Duser.language=en -Duser.country=US
LOADING SOURCE FILES FOR PACKAGE p...
CONSTRUCTING JAVADOC INFORMATION...


If this works, we can avoid changing each test case individually.

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

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


More information about the compiler-dev mailing list