United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-8005290 TEST_BUG: remove -showversion from RMI test library subprocess mechanism
JDK-8005290 : TEST_BUG: remove -showversion from RMI test library subprocess mechanism

Details
Type:
Bug
Submit Date:
2012-12-20
Status:
Closed
Updated Date:
2013-12-17
Project Name:
JDK
Resolved Date:
2012-12-21
Component:
core-libs
OS:
Sub-Component:
java.rmi
CPU:
Priority:
P4
Resolution:
Fixed
Affected Versions:
Fixed Versions:

Related Reports
Backport:
Backport:
Backport:
Backport:
Backport:
Relates:

Sub Tasks

Description
The RMI test library (jdk/test/java/rmi/testlibrary) has a convenience API (the JavaVM class) for launching a JVM subprocess. When starting the subprocess, it adds the -showversion option to the JVM command line and waits for the version output to arrive from the subprocess before returning to the caller. This mechanism was added because the original code unconditionally slept for two seconds before returning to the caller, in an attempt to delay the caller until the JVM subprocess was ready. The -showversion mechanism reduced the wait time if the JVM subprocess became ready sooner.

It turns out this is no longer necessary.

The two-second delay was insufficient to avoid race conditions. Callers that need to interact with the JVM subprocess have to have their own wait/retry logic anyway. Indeed, this is elsewhere in the RMI test library already (RMID.java, ActivationLibrary.java), and in fact all the RMI tests pass with the two-second sleep and showversion mechanism removed, even if an extra delay is added to the subprocess.

Thus the two-second delay and the -showversion mechanism can be removed entirely.

                                    

Comments
The initial developer of the showversion mechanism, olagneau, pointed out that the original code waited for the child JVM unconditionally for two seconds. The showversion mechanism was an optimization so that the test didn't have to wait the full two seconds if the child JVM came up faster. But the tests still seem to work even without the two-second delay, so the showversion mechanism isn't necessary either.
                                     
2012-12-20
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/60adb69bf043
User:  smarks
Date:  2012-12-21 05:42:14 +0000

                                     
2012-12-21
URL:   http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/60adb69bf043
User:  lana
Date:  2012-12-31 05:48:05 +0000

                                     
2012-12-31



Hardware and Software, Engineered to Work Together