diff --git a/test/ProblemList.txt b/test/ProblemList.txt index d0f0921fc51561ff4064ca838b7dcf7f449f8d52..0e843b159b9b76016a68ee0aa71492023467bce6 100644 --- a/test/ProblemList.txt +++ b/test/ProblemList.txt @@ -141,9 +141,6 @@ java/lang/management/MemoryMXBean/LowMemoryTest2.sh generic-all # jdk_management -# 7158614 -sun/management/jmxremote/startstop/JMXStartStopTest.sh linux-all - ############################################################################ # jdk_jmx diff --git a/test/sun/management/jmxremote/startstop/JMXStartStopDoSomething.java b/test/sun/management/jmxremote/startstop/JMXStartStopDoSomething.java index a68d185b3654e4e5fdc5345e42eb9bb624d06334..98b759ea79aac824aa2c599d452b3e5b8d3d7025 100644 --- a/test/sun/management/jmxremote/startstop/JMXStartStopDoSomething.java +++ b/test/sun/management/jmxremote/startstop/JMXStartStopDoSomething.java @@ -41,7 +41,7 @@ public class JMXStartStopDoSomething { System.err.println("Lock is too old. Aborting"); return; } - Thread.sleep(1); + Thread.sleep(500); } } catch (Throwable e) { diff --git a/test/sun/management/jmxremote/startstop/JMXStartStopTest.sh b/test/sun/management/jmxremote/startstop/JMXStartStopTest.sh index 6d48e17202aa21d3dc83293b88751ab82aa6dddb..a6bf11ad84ca9b3bcb48edabe19dfa7c0ad8256c 100644 --- a/test/sun/management/jmxremote/startstop/JMXStartStopTest.sh +++ b/test/sun/management/jmxremote/startstop/JMXStartStopTest.sh @@ -43,7 +43,7 @@ _lockFileName="JMXStartStop.lck" _compile(){ - if [ ! -e ${_testclasses} ] + if [ ! -d ${_testclasses} ] then mkdir -p ${_testclasses} fi @@ -53,7 +53,7 @@ _compile(){ # Compile testcase ${TESTJAVA}/bin/javac -d ${_testclasses} JMXStartStopDoSomething.java JMXStartStopTest.java - if [ ! -e ${_testclasses}/JMXStartStopTest.class ] + if [ ! -f ${_testclasses}/JMXStartStopTest.class ] then echo "ERROR: Can't compile" exit -1 @@ -61,17 +61,24 @@ _compile(){ } _app_start(){ - ${TESTJAVA}/bin/java ${TESTVMOPTS} $* -cp ${_testclasses} JMXStartStopDoSomething >> ${_logname} 2>&1 & + ${TESTJAVA}/bin/java -server $* -cp ${_testclasses} JMXStartStopDoSomething >> ${_logname} 2>&1 & - npid=`_get_pid` - if [ "${npid}" = "" ] - then - echo "ERROR: Test app not started" - if [ "${_jtreg}" = "yes" ] + x=0 + while [ ! -f ${_lockFileName} ] + do + if [ $x -gt 20 ] then - exit -1 - fi - fi + echo "ERROR: Test app not started" + if [ "${_jtreg}" = "yes" ] + then + exit -1 + fi + fi + + echo "Waiting JMXStartStopDoSomething to start: $x" + x=`expr $x + 1` + sleep 1 + done } _get_pid(){ @@ -103,7 +110,7 @@ _exit_on_jtreg(){ } _testme(){ - ${TESTJAVA}/bin/java ${TESTVMOPTS} -cp ${_testclasses} JMXStartStopTest $* + ${TESTJAVA}/bin/java -cp ${_testclasses} JMXStartStopTest $* }