提交 7352c405 编写于 作者: S sjiang

7158614: JMXStartStopTest.sh failing intermittently

Summary: fixed 3 problems here: 1) checked the lock file too eary 2) never got the process id of a java test 3) some shell commands were not supported in some Solaris machines.
Reviewed-by: dsamersoff, alanb
上级 0d96340e
...@@ -141,9 +141,6 @@ java/lang/management/MemoryMXBean/LowMemoryTest2.sh generic-all ...@@ -141,9 +141,6 @@ java/lang/management/MemoryMXBean/LowMemoryTest2.sh generic-all
# jdk_management # jdk_management
# 7158614
sun/management/jmxremote/startstop/JMXStartStopTest.sh linux-all
############################################################################ ############################################################################
# jdk_jmx # jdk_jmx
......
...@@ -41,7 +41,7 @@ public class JMXStartStopDoSomething { ...@@ -41,7 +41,7 @@ public class JMXStartStopDoSomething {
System.err.println("Lock is too old. Aborting"); System.err.println("Lock is too old. Aborting");
return; return;
} }
Thread.sleep(1); Thread.sleep(500);
} }
} catch (Throwable e) { } catch (Throwable e) {
......
...@@ -43,7 +43,7 @@ _lockFileName="JMXStartStop.lck" ...@@ -43,7 +43,7 @@ _lockFileName="JMXStartStop.lck"
_compile(){ _compile(){
if [ ! -e ${_testclasses} ] if [ ! -d ${_testclasses} ]
then then
mkdir -p ${_testclasses} mkdir -p ${_testclasses}
fi fi
...@@ -53,7 +53,7 @@ _compile(){ ...@@ -53,7 +53,7 @@ _compile(){
# Compile testcase # Compile testcase
${TESTJAVA}/bin/javac -d ${_testclasses} JMXStartStopDoSomething.java JMXStartStopTest.java ${TESTJAVA}/bin/javac -d ${_testclasses} JMXStartStopDoSomething.java JMXStartStopTest.java
if [ ! -e ${_testclasses}/JMXStartStopTest.class ] if [ ! -f ${_testclasses}/JMXStartStopTest.class ]
then then
echo "ERROR: Can't compile" echo "ERROR: Can't compile"
exit -1 exit -1
...@@ -61,17 +61,24 @@ _compile(){ ...@@ -61,17 +61,24 @@ _compile(){
} }
_app_start(){ _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` x=0
if [ "${npid}" = "" ] while [ ! -f ${_lockFileName} ]
then do
echo "ERROR: Test app not started" if [ $x -gt 20 ]
if [ "${_jtreg}" = "yes" ]
then then
exit -1 echo "ERROR: Test app not started"
fi if [ "${_jtreg}" = "yes" ]
fi then
exit -1
fi
fi
echo "Waiting JMXStartStopDoSomething to start: $x"
x=`expr $x + 1`
sleep 1
done
} }
_get_pid(){ _get_pid(){
...@@ -103,7 +110,7 @@ _exit_on_jtreg(){ ...@@ -103,7 +110,7 @@ _exit_on_jtreg(){
} }
_testme(){ _testme(){
${TESTJAVA}/bin/java ${TESTVMOPTS} -cp ${_testclasses} JMXStartStopTest $* ${TESTJAVA}/bin/java -cp ${_testclasses} JMXStartStopTest $*
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册