RFR(XS): 8008188: Add regression test for 8005875

John Cuthbertson john.cuthbertson at oracle.com
Thu Feb 14 18:08:49 UTC 2013

Hi Bengt,

Thanks for looking at the test.

On 2/13/2013 11:27 PM, Bengt Rutisson wrote:
> Hi John,
> Nice test!
> Using the testlibrary really makes these test readable!

Agree. Makes life a lot easier.

> A couple of minor comments:
> Since ProcessBuilder.command() takes variable number of String 
> arguments, you don't have to create a String[] yourself. You can let 
> the JDK do that for you. So, this line:
>     pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, 
> "Thread.print"});
> Could be simplified to:
>     pb.command(JDKToolFinder.getJDKTool("jcmd"), pid, "Thread.print");

OK. I followed Christian Tornqvist's guidelines and the code was checked 
against the AllocTypeTest.java regression test in the NMT tests. I 
thought it was a convention.

> Also, you call the test Test8005875. I think this is what we used to 
> do. But I have been told that it is better to use the @bug tag to 
> indicate the bug number and call the test something meaningful. I like 
> this much better since if the test fails you can actually get a clue 
> of what is going wrong.
> And I think you should give a name to the @name tag
> So I would prefer something like:
> /* @test TestG1JcmdThreadPrint
>   * @bug 8005875
>  * @summary Use jcmd to generate a thread dump of a Java program being 
> run with G1 and PGCT=0 to verify 8005875
>  * @library /testlibrary
>  * @run main/othervm -XX:+UseG1GC -XX:ParallelGCThreads=0 
> -XX:+IgnoreUnrecognizedVMOptions TestG1JcmdThreadPrint
>  */
> import com.oracle.java.testlibrary.*;
> public class TestG1JcmdThreadPrint {

Sure, no problem.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-gc-dev/attachments/20130214/d423982f/attachment.htm>

More information about the hotspot-gc-dev mailing list