RFR 8228589: BasicJStackTest.java and JcmdOutputEncodingTest.java failing after JDK-8227868

Severin Gehwolf sgehwolf at redhat.com
Thu Jul 25 13:56:09 UTC 2019


Hi Ralf,

On Thu, 2019-07-25 at 13:09 +0000, Schmelter, Ralf wrote:
> The tests included to check the correct UTF-8 conversion of
> jstack/jinfo/jcmd will fail, if the platform encoding cannot
> represent the Unicode characters we used in the code. These
> characters will be correctly converted by the tools, but when printed
> out on System.out, the PrintSteam has to convert the chars to bytes.
> And if a Unicode character is not supported by the platform encoding,
> a question mark is used instead. 
> 
> This is what happened on some machines the test was run. To fix this,
> we now set the encoding used to UTF-8 explicitly. I had to adapt some
> test library code to add the option of using a specific charset for
> the conversion from bytes to chars.
> 
> webrev: http://cr.openjdk.java.net/~rschmelter/webrevs/8228589/webrev.0/
> bugreport: https://bugs.openjdk.java.net/browse/JDK-8228589

This looks mostly OK.

  37 public class BasicJStackTest {
[...]
  42     public static void main(String[] args) throws Exception {
  43         testJstackNoArgs();
  44         testJstack_l();

Perhaps there should be a 'testJstackUTF8Output()' which will use the
thai symbol. Only that test method would use the special-needing-UTF-8-
marker. This would help diagnosing test failures when the test fails
again. Some food for thought.

Thanks,
Severin



More information about the serviceability-dev mailing list