HBASE-7350 - Flakey tests make CI unreliable - addendum on the zombie detection

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1425463 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
nkeywal 2012-12-23 13:15:21 +00:00
parent 9fac4877d3
commit 17ab8864c6
1 changed files with 17 additions and 8 deletions

View File

@ -621,16 +621,25 @@ runTests () {
fi fi
ZOMBIE_TESTS_COUNT=`jps | grep surefirebooter | wc -l` ZOMBIE_TESTS_COUNT=`jps | grep surefirebooter | wc -l`
if [[ $ZOMBIE_TESTS_COUNT != 0 ]] ; then if [[ $ZOMBIE_TESTS_COUNT != 0 ]] ; then
echo "There are $ZOMBIE_TESTS_COUNT zombie tests, they should have been killed by surefire but survived" #It seems sometimes the tests are not dying immediately. Let's give them 30s
echo "************ BEGIN zombies jstack extract" echo "Suspicious java process found - waiting 30s to see if there are just slow to stop"
jps | grep surefirebooter | cut -d ' ' -f 1 | xargs -n 1 jstack | grep ".test" | grep "\.java" sleep 30
echo "************ END zombies jstack extract" ZOMBIE_TESTS_COUNT=`jps | grep surefirebooter | wc -l`
JIRA_COMMENT="$JIRA_COMMENT if [[ $ZOMBIE_TESTS_COUNT != 0 ]] ; then
echo "There are $ZOMBIE_TESTS_COUNT zombie tests, they should have been killed by surefire but survived"
echo "************ BEGIN zombies jstack extract"
ZB_STACK=`jps | grep surefirebooter | cut -d ' ' -f 1 | xargs -n 1 jstack | grep ".test" | grep "\.java"`
jps | grep surefirebooter | cut -d ' ' -f 1 | xargs -n 1 jstack
echo "************ END zombies jstack extract"
JIRA_COMMENT="$JIRA_COMMENT
{color:red}-1 core zombie tests{color}. There are zombie tests. See build logs for details." {color:red}-1 core zombie tests{color}. There are ${ZOMBIE_TESTS_COUNT} zombie test(s): ${ZB_STACK}"
BAD=1 BAD=1
else
echo "We're ok: there is no zombie test, but some tests took some time to stop"
fi
else else
echo "We're ok: there is no zombie tests" echo "We're ok: there is no zombie test"
fi fi
return $BAD return $BAD
} }