8037345: com/sun/jdi/* tests can fail, with race condition on log files

Reviewed-by: sspitsyn, dcubed
This commit is contained in:
Staffan Larsen 2014-03-31 11:28:03 +02:00
parent 278ed96ea7
commit e7aed74165

View File

@ -908,7 +908,7 @@ startDebuggee()
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 @@ waitForFinish()
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 @@ waitForFinish()
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 @@ grepForString()
fi
unset theFile
esac
return $stat
}