RFR: 8291081: Some sun/tools/jstatd/TestJstatd* tests fail with "Not a percentage\: 68.31\: expected true, was false" [v2]
Leonid Mesnik
lmesnik at openjdk.org
Tue Aug 9 20:37:45 UTC 2022
On Tue, 9 Aug 2022 14:20:13 GMT, Kevin Walls <kevinw at openjdk.org> wrote:
> Thanks, great to fix the verifier now if we can.
>
> I do think that never setting user.language is good. Forcing jstat to run with user.language=en could be wrong, as there is a risk of mismatching the printing and the verification.
>
> BUT I don't see why I can't reproduce the problem.. The report is on Windows, and I can sign in using a non-English language but can't make the test fail!...
I didn't try to change system locale. I used TEST_OPTS_JAVA_OPTIONS="-Duser.language=vi" to verify that it fails wit this message and set '-Duser.language=vi' for jstat to see that test pass if all locales are same.
You could try just to print numbers in java to check if "," actually used as decimal separator. Also the "S0" should not be zero to fail.
>
> But then it's not the parsing in NumberFormat that fails, it's the assert afterwards.
>
Yep, the number is parsed without exception because the "." is a thousand separator. So it is just ignored.
>
> Annoyingly we print the literal String value "68.31" but not the double percentage that it parsed....
Fixed to print value. Now:
java.lang.RuntimeException: Not a percentage. value: 91.10 percentage: 9110.0: expected true, was false
-------------
PR: https://git.openjdk.org/jdk/pull/9798
More information about the serviceability-dev
mailing list