RFR 8048193: [tests] Replace JPS and stdout based PID retrieval by Process.getPid()

Staffan Larsen staffan.larsen at oracle.com
Tue Jul 1 06:17:06 UTC 2014


Jaroslav,

Great cleanup! 

How about using Process.destroyForcibly() instead of sending the “shutdown” message? Maybe not as “nice”, but much less code.

test/sun/tools/jstatd/JstatdTest.java:
 323                     port = Integer.toString(31111); //Utils.getFreePort());
 Looks like a mistake?


/Staffan


On 30 jun 2014, at 18:43, Jaroslav Bachorik <jaroslav.bachorik at oracle.com> wrote:

> Please, review the following test change.
> 
> Issue : https://bugs.openjdk.java.net/browse/JDK-8048193
> Webrev: http://cr.openjdk.java.net/~jbachorik/8048193/webrev.00
> 
> Intricate log parsing in order to get an application PID is replaced with the new Process.getPid() API call. While doing this cleanup it also become obvious that it was unnecessary to start a socket server for each launched test application just in order to shut it down when the same functionality can be achieved through the usage of stdin/stdout provided by the Process instance.
> 
> Thanks,
> 
> -JB-



More information about the serviceability-dev mailing list