RFR 8035395: sun/management/jmxremote/startstop/JMXStartStopTest.java fails intermittently: Port already in use (original) (raw)

shanliang shanliang.jiang at oracle.com
Thu Feb 20 10:20:08 PST 2014


Jaroslav,

The failed tests were: 1, 7, 8, 9

but the tests using this port (port2: 50235) were 1, 3, 4, 6, 7, 8, 9

and tests 2,4,6 were passed.

so I think that the problem might be that the port was not fully released when a test was trying to use it, even the port was closed by the previous test.

Your solution is to create a Server socket on a free port, then release it when a test needs it. I suspect whether we will fall into same issue here: the port would not be fully released when using it?

Shanliang

Jaroslav Bachorik wrote:

Please, review this test fix.

Issue : https://bugs.openjdk.java.net/browse/JDK-8035395 Webrev: http://cr.openjdk.java.net/~jbachorik/8035395/webrev.00 Currently, the test is using two fixed ports to start JMX connector and RMI registry when necessary. It can not deal with situations when the ports are not available. The patch is adding the ability to obtain ports from the ephemeral range and use them instead of the hardcoded ones. It also tries to minimize the chance of another process stealing the ports by holding the corresponding SocketServers open till right before the port is actually needed. Thanks, -JB-



More information about the serviceability-dev mailing list