提交 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
# jdk_management
# 7158614
sun/management/jmxremote/startstop/JMXStartStopTest.sh linux-all
############################################################################
# jdk_jmx
......
......@@ -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) {
......
......@@ -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 $*
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册