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

Bengt Rutisson bengt.rutisson at oracle.com
Thu Feb 14 07:27:27 UTC 2013

Hi John,

Nice test!

Using the testlibrary really makes these test readable!

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, 

Could be simplified to:

     pb.command(JDKToolFinder.getJDKTool("jcmd"), pid, "Thread.print");

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 {

On 2/14/13 1:51 AM, John Cuthbertson wrote:
> Hi Everyone,
> Can I have a couple of volunteers review the regression test for 
> 8005875 - the webrev can be found at: 
> http://cr.openjdk.java.net/~johnc/8008188/webrev.0/
> The test is very simple and issues "jcmd <pid> Thread.print" against 
> itself. With G1 and PGCT=0, and before the fix for 8005875, this 
> command crashes the VM.
> Testing:
> jdk8 build (b76) with fix for 8005875; jdk8 build (b71) without fix 
> for 8005875; Changed the test options to run the test with the invalid 
> flag -XX:+UseG2GC.
> Thanks,
> JohnC

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/hotspot-gc-dev/attachments/20130214/c0002b5c/attachment.htm>

More information about the hotspot-gc-dev mailing list