diff --git a/dev-support/test-patch.sh b/dev-support/test-patch.sh index e6a377a32fd..bb26e959177 100755 --- a/dev-support/test-patch.sh +++ b/dev-support/test-patch.sh @@ -707,6 +707,12 @@ 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 -e surefirebooter -e '-Dhbase.test' | wc -l` +} + ############################################################################### ### Run the tests runTests () { @@ -720,10 +726,6 @@ runTests () { echo "" echo "" - - ### kill any process remaining from another test, maybe even another project - jps | grep surefirebooter | cut -d ' ' -f 1 | xargs kill -9 2>/dev/null - failed_tests="" ### Kill any rogue build processes from the last attempt condemnedCount=`$PS auxwww | $GREP ${PROJECT_NAME}PatchProcess | $AWK '{print $2}' | $AWK 'BEGIN {total = 0} {total += 1} END {print total}'` @@ -748,23 +750,25 @@ runTests () { {color:green}+1 core tests{color}. The patch passed unit tests in $modules." BAD=0 fi - ZOMBIE_TESTS_COUNT=`jps | grep surefirebooter | wc -l` + 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=`jps | grep surefirebooter | wc -l` + ZOMBIE_TESTS_COUNT=`zombieCount` 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 + # 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 -e surefirebooter -e '-Dhbase.test' | cut -d ' ' -f 1 | xargs -n 1 jstack | grep ".test" | grep "\.java"` + jps -v | grep -e surefirebooter -e '-Dhbase.test' | 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_COUNT} zombie test(s): ${ZB_STACK}" BAD=1 - jps | grep surefirebooter | cut -d ' ' -f 1 | xargs kill -9 + jps -v | grep -e surefirebooter -e '-Dhbase.test' | cut -d ' ' -f 1 | xargs kill -9 else echo "We're ok: there is no zombie test, but some tests took some time to stop" fi diff --git a/pom.xml b/pom.xml index 9751762a8b1..8c961775c7f 100644 --- a/pom.xml +++ b/pom.xml @@ -1217,7 +1217,9 @@ 2800m 2800m - -enableassertions -XX:MaxDirectMemorySize=1G -Xmx${surefire.Xmx} + + -enableassertions -Dhbase.test -Xmx${surefire.Xmx} -XX:MaxPermSize=256m -Djava.security.egd=file:/dev/./urandom -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true