提交 3ee7b379 编写于 作者: K kshefov

8038963: com/sun/jdi tests fail because cygwin's ps sometimes misses processes

Reviewed-by: coffeys
上级 dc3ef3c5
...@@ -195,30 +195,26 @@ killOrphans() ...@@ -195,30 +195,26 @@ killOrphans()
findPid() findPid()
{ {
# Return 0 if $1 is the pid of a running process. # Return 0 if $1 is the pid of a running process.
if [ -z "$isWin98" ] ; then case "$osname" in
if [ "$osname" = SunOS ] ; then SunOS | AIX)
# Solaris and OpenSolaris use pgrep and not ps in psCmd $psCmd | $grep '^ *'"$1 " > $devnull 2>&1
findPidCmd="$psCmd" res=$?
elif [ "$osname" = AIX ] ; then ;;
findPidCmd="$psCmd" Windows* | CYGWIN*)
else # Don't use ps on cygwin since it sometimes misses
# some processes (!).
tasklist /NH | $grep " $1 " > $devnull 2>&1
res=$?
;;
*)
# Never use plain 'ps', which requires a "controlling terminal" # Never use plain 'ps', which requires a "controlling terminal"
# and will fail with a "ps: no controlling terminal" error. # and will fail with a "ps: no controlling terminal" error.
# Running under 'rsh' will cause this ps error. # Running under 'rsh' will cause this ps error.
# cygwin ps puts an I in column 1 for some reason. $psCmd -e | $grep '^ *'"$1 " > $devnull 2>&1
findPidCmd="$psCmd -e" res=$?
fi ;;
$findPidCmd | $grep '^I* *'"$1 " > $devnull 2>&1 esac
return $? return $res
fi
# mks 6.2a on win98 has $! getting a negative
# number and in ps, it shows up as 0x...
# Thus, we can't search in ps output for
# PIDs gotten via $!
# We don't know if it is running or not - assume it is.
# We don't really care about win98 anymore.
return 0
} }
setup() setup()
...@@ -248,17 +244,10 @@ setup() ...@@ -248,17 +244,10 @@ setup()
ulimitCmd= ulimitCmd=
osname=`uname -s` osname=`uname -s`
isWin98=
isCygwin= isCygwin=
case "$osname" in case "$osname" in
Windows* | CYGWIN*) Windows* | CYGWIN*)
devnull=NUL devnull=NUL
if [ "$osname" = Windows_98 -o "$osname" = Windows_ME ]; then
isWin98=1
debuggeeKeyword='we_cant_kill_debuggees_on_win98'
jdbKeyword='jdb\.exe'
fi
case "$osname" in case "$osname" in
CYGWIN*) CYGWIN*)
isCygwin=1 isCygwin=1
...@@ -743,7 +732,7 @@ waitForJdbMsg() ...@@ -743,7 +732,7 @@ waitForJdbMsg()
sleep ${sleep_seconds} sleep ${sleep_seconds}
findPid $topPid findPid $topPid
if [ $? != 0 ] ; then if [ $? != 0 ] ; then
# Top process is dead. We better die too echo "--Top process ($topPid) is dead. We better die too" >&2
dojstack dojstack
exit 1 exit 1
fi fi
...@@ -931,12 +920,6 @@ waitForFinish() ...@@ -931,12 +920,6 @@ waitForFinish()
if [ $? != 0 ] ; then if [ $? != 0 ] ; then
break break
fi fi
if [ ! -z "$isWin98" ] ; then
$psCmd | $grep -i 'JDB\.EXE' >$devnull 2>&1
if [ $? != 0 ] ; then
break;
fi
fi
$grep -s 'Input stream closed' $jdbOutFile > $devnull 2>&1 $grep -s 'Input stream closed' $jdbOutFile > $devnull 2>&1
if [ $? = 0 ] ; then if [ $? = 0 ] ; then
#something went wrong #something went wrong
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册