changeset 9566:570a7eea9c48

8037345: com/sun/jdi/* tests can fail, with race condition on log files Reviewed-by: sspitsyn, dcubed
author sla
date Mon, 31 Mar 2014 11:28:03 +0200
parents b7bb452b954b
children e0d1a825848f
files test/com/sun/jdi/ShellScaffold.sh
diffstat 1 files changed, 16 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/test/com/sun/jdi/ShellScaffold.sh	Mon Mar 31 11:09:04 2014 +0200
+++ b/test/com/sun/jdi/ShellScaffold.sh	Mon Mar 31 11:28:03 2014 +0200
@@ -908,7 +908,7 @@
     debuggeepid=
     waitForJdbMsg Listening 4
 
-    beOption="-agentlib:jdwp=transport=$transport,address=$address,server=n,suspend=y"
+    beOption="-agentlib:jdwp=transport=$transport,address=$address,server=n,suspend=y" 
 #   beOption="-Xdebug -Xrunjdwp:transport=$transport,address=$address,server=n,suspend=y"
 
     thecmd="$jdk/bin/$java $mode -classpath $tmpFileDir $baseArgs $args \
@@ -976,14 +976,20 @@
         if [ $? != 0 ] ; then
             break
         fi
+
         if [ ! -z "$isWin98" ] ; then
             $psCmd | $grep -i 'JDB\.EXE' >$devnull 2>&1
             if [ $? != 0 ] ; then
                 break
             fi
         fi
-        # Something went wrong
-        jdbFailIfPresent "Input stream closed"
+
+        # (Don't use jdbFailIfPresent here since it is not safe 
+        # to call from different processes)
+	$grep -s 'Input stream closed' $jdbOutFile > $devnull 2>&1
+	if [ $? = 0 ] ; then
+            dofail "jdb input stream closed prematurely"
+	fi
 
         # If a failure has occured, quit
         if [ -r "$failFile" ] ; then
@@ -994,7 +1000,12 @@
     done
 
     # jdb exited because its input stream closed prematurely
-    jdbFailIfPresent "Input stream closed"
+    # (Don't use jdbFailIfPresent here since it is not safe 
+    # to call from different processes)
+    $grep -s 'Input stream closed' $jdbOutFile > $devnull 2>&1
+    if [ $? = 0 ] ; then
+        dofail "jdb input stream closed prematurely"
+    fi
 
     # It is necessary here to avoid the situation when JDB exited but
     # mydojdbCmds() didn't finish because it waits for JDB message
@@ -1085,6 +1096,7 @@
         fi
         unset theFile
     esac
+
     return $stat
 }