Please, review this test change Issue : https://bugs.openjdk.java.net/browse/JDK-8057149 Webrev: http://cr.openjdk.java.net/~jbachorik/8057149/webrev.00
The test is using 'jcmd' to start/stop the JMX agent dynamically with various parameters. Some of the tests use a server socket to simulate starting the agent with the desired port not being available. However, it seems that in certain situations the agent does not provide a conscious error message and fails with RuntimeException instead. This seems to be timing related and therefore the solution is to retry the 'jcmd' command a few times with a delay to provide some cushion for the timing related problems.
Thanks, -JB-