HBASE-14772 Improve zombie detector; be more discerning; ADDENDUM -- remove zombie detection from test-patch.sh and rely on script instead
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/0af651bd Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/0af651bd Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/0af651bd Branch: refs/heads/hbase-12439 Commit: 0af651bde5dfd53303e1ffe78deccaf7b665c138 Parents: 4c2e0d9 Author: stack <st...@apache.org> Authored: Mon Nov 9 07:12:27 2015 -1000 Committer: stack <st...@apache.org> Committed: Mon Nov 9 07:12:27 2015 -1000 ---------------------------------------------------------------------- dev-support/test-patch.sh | 31 +------------------------------ dev-support/zombie-detector.sh | 5 ++++- 2 files changed, 5 insertions(+), 31 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/0af651bd/dev-support/test-patch.sh ---------------------------------------------------------------------- diff --git a/dev-support/test-patch.sh b/dev-support/test-patch.sh index 4ad37ab..c6ea897 100755 --- a/dev-support/test-patch.sh +++ b/dev-support/test-patch.sh @@ -833,12 +833,6 @@ checkLineLengths () { return 0 } -zombieCount() { - # HBase tests have been flagged with an innocuous '-Dhbase.test' just so they can - # be identified as hbase in a process listing. - echo `jps -v | grep surefirebooter | grep -e '-Dhbase.test' | wc -l` -} - ############################################################################### ### Run the tests runTests () { @@ -875,31 +869,8 @@ runTests () { # NOTE!!!! The below code has been copied and pasted up into jenkins as an post-build task. # Make sure to update it too if you change the below (Or extract below into script to checkout # to run post-build) + export JIRA_COMMENT $BASEDIR/dev-support/zombie-detector.sh ${BUILD_ID} - ZOMBIE_TESTS_COUNT=`zombieCount` - if [[ $ZOMBIE_TESTS_COUNT != 0 ]] ; then - # It seems sometimes the tests are not dying immediately. Let's give them 30s - echo "Suspicious java process found - waiting 30s to see if there are just slow to stop" - sleep 30 - ZOMBIE_TESTS_COUNT=`zombieCount` - if [[ $ZOMBIE_TESTS_COUNT != 0 ]] ; then - echo "There appear to be $ZOMBIE_TESTS_COUNT zombie tests, they should have been killed by surefire but survived" - jps -v | grep surefirebooter | grep -e '-Dhbase.test' - echo "************ BEGIN zombies jstack extract" - # HBase tests have been flagged with an innocuous '-Dhbase.test' just so they can be identified as hbase in a process listing. - ZB_STACK=`jps -v | grep surefirebooter | grep -e '-Dhbase.test' | cut -d ' ' -f 1 | xargs -n 1 jstack | grep ".test" | grep "\.java"` - echo "************ END zombies jstack extract" - JIRA_COMMENT="$JIRA_COMMENT - - {color:red}-1 core zombie tests{color}. There are possible ${ZOMBIE_TESTS_COUNT} zombie test(s): ${ZB_STACK}" - BAD=1 - else - echo "We're ok: there is no zombie test, but some tests took some time to stop" - fi - else - echo "We're ok: there is no zombie test" - fi - return $BAD } ############################################################################### http://git-wip-us.apache.org/repos/asf/hbase/blob/0af651bd/dev-support/zombie-detector.sh ---------------------------------------------------------------------- diff --git a/dev-support/zombie-detector.sh b/dev-support/zombie-detector.sh index 59a73f1..a7856eb 100755 --- a/dev-support/zombie-detector.sh +++ b/dev-support/zombie-detector.sh @@ -103,7 +103,8 @@ zombies () { ZOMBIE_TESTS_COUNT=`echo "${ZOMBIES}"|wc -l|xargs` if [[ $ZOMBIE_TESTS_COUNT != 0 ]] ; then wait=30 - echo "`date` Found ${ZOMBIE_TESTS_COUNT} suspicious java process(es); waiting ${wait}s to see if just slow to stop" + echo "`date` Found ${ZOMBIE_TESTS_COUNT} suspicious java process(es) listed below; waiting ${wait}s to see if just slow to stop" + echo ${ZOMBIES} sleep ${wait} PIDS=`echo "${ZOMBIES}"|${AWK} '{print $1}'` ZOMBIE_TESTS_COUNT=0 @@ -130,6 +131,8 @@ zombies () { exit 1 else echo "`date` We're ok: there is no zombie test" + JIRA_COMMENT="$JIRA_COMMENT + {color:green}+1 core zombie tests -- no zombies!{color}." fi fi }