changeset 6293:c79b26b8efe0

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
author sjiang
date Wed, 19 Dec 2012 11:06:51 +0100
parents e515956879cd
children 3fd3bcc8bd42
files test/ProblemList.txt test/sun/management/jmxremote/startstop/JMXStartStopDoSomething.java test/sun/management/jmxremote/startstop/JMXStartStopTest.sh
diffstat 3 files changed, 20 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/test/ProblemList.txt	Tue Dec 18 18:14:50 2012 -0800
+++ b/test/ProblemList.txt	Wed Dec 19 11:06:51 2012 +0100
@@ -141,9 +141,6 @@
 
 # jdk_management
 
-# 7158614
-sun/management/jmxremote/startstop/JMXStartStopTest.sh		linux-all
-
 ############################################################################
 
 # jdk_jmx
--- a/test/sun/management/jmxremote/startstop/JMXStartStopDoSomething.java	Tue Dec 18 18:14:50 2012 -0800
+++ b/test/sun/management/jmxremote/startstop/JMXStartStopDoSomething.java	Wed Dec 19 11:06:51 2012 +0100
@@ -41,7 +41,7 @@
                     System.err.println("Lock is too old. Aborting");
                     return;
                 }
-                Thread.sleep(1);
+                Thread.sleep(500);
             }
 
         } catch (Throwable e) {
--- a/test/sun/management/jmxremote/startstop/JMXStartStopTest.sh	Tue Dec 18 18:14:50 2012 -0800
+++ b/test/sun/management/jmxremote/startstop/JMXStartStopTest.sh	Wed Dec 19 11:06:51 2012 +0100
@@ -43,7 +43,7 @@
 
 _compile(){
 
-    if [ ! -e ${_testclasses} ]
+    if [ ! -d ${_testclasses} ]
     then
       mkdir -p ${_testclasses} 
     fi   
@@ -53,7 +53,7 @@
     # 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 @@
 }
 
 _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 @@
 }
 
 _testme(){
-  ${TESTJAVA}/bin/java ${TESTVMOPTS} -cp ${_testclasses} JMXStartStopTest $*
+  ${TESTJAVA}/bin/java -cp ${_testclasses} JMXStartStopTest $*
 }