HBASE-14349 pre-commit zombie finder is overly broad

This commit is contained in:
stack 2015-10-07 13:41:27 -07:00
parent 4e876c59f4
commit e1fd3526b1
2 changed files with 16 additions and 10 deletions

View File

@ -833,6 +833,12 @@ checkLineLengths () {
return 0 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 ### Run the tests
runTests () { runTests () {
@ -846,10 +852,6 @@ runTests () {
echo "" echo ""
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="" failed_tests=""
### Kill any rogue build processes from the last attempt ### 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}'` condemnedCount=`$PS auxwww | $GREP ${PROJECT_NAME}PatchProcess | $AWK '{print $2}' | $AWK 'BEGIN {total = 0} {total += 1} END {print total}'`
@ -874,23 +876,25 @@ runTests () {
{color:green}+1 core tests{color}. The patch passed unit tests in $modules." {color:green}+1 core tests{color}. The patch passed unit tests in $modules."
BAD=0 BAD=0
fi fi
ZOMBIE_TESTS_COUNT=`jps | grep surefirebooter | wc -l` ZOMBIE_TESTS_COUNT=`zombieCount`
if [[ $ZOMBIE_TESTS_COUNT != 0 ]] ; then if [[ $ZOMBIE_TESTS_COUNT != 0 ]] ; then
#It seems sometimes the tests are not dying immediately. Let's give them 30s #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" echo "Suspicious java process found - waiting 30s to see if there are just slow to stop"
sleep 30 sleep 30
ZOMBIE_TESTS_COUNT=`jps | grep surefirebooter | wc -l` ZOMBIE_TESTS_COUNT=`zombieCount`
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" echo "There are $ZOMBIE_TESTS_COUNT zombie tests, they should have been killed by surefire but survived"
echo "************ BEGIN zombies jstack extract" echo "************ BEGIN zombies jstack extract"
ZB_STACK=`jps | grep surefirebooter | cut -d ' ' -f 1 | xargs -n 1 jstack | grep ".test" | grep "\.java"` # HBase tests have been flagged with an innocuous '-Dhbase.test' just so they can
jps | grep surefirebooter | cut -d ' ' -f 1 | xargs -n 1 jstack # 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" echo "************ END zombies jstack extract"
JIRA_COMMENT="$JIRA_COMMENT JIRA_COMMENT="$JIRA_COMMENT
{color:red}-1 core zombie tests{color}. There are ${ZOMBIE_TESTS_COUNT} zombie test(s): ${ZB_STACK}" {color:red}-1 core zombie tests{color}. There are ${ZOMBIE_TESTS_COUNT} zombie test(s): ${ZB_STACK}"
BAD=1 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 else
echo "We're ok: there is no zombie test, but some tests took some time to stop" echo "We're ok: there is no zombie test, but some tests took some time to stop"
fi fi

View File

@ -1292,7 +1292,9 @@
<!-- default Xmx value is 2800m. Use -Dsurefire.Xmx=xxg to run tests with different JVM Xmx value --> <!-- default Xmx value is 2800m. Use -Dsurefire.Xmx=xxg to run tests with different JVM Xmx value -->
<surefire.Xmx>2800m</surefire.Xmx> <surefire.Xmx>2800m</surefire.Xmx>
<surefire.cygwinXmx>2800m</surefire.cygwinXmx> <surefire.cygwinXmx>2800m</surefire.cygwinXmx>
<hbase-surefire.argLine>-enableassertions -XX:MaxDirectMemorySize=1G -Xmx${surefire.Xmx} <!--Mark our test runs with '-Dhbase.test' so we can identify a surefire test as ours in a process listing
-->
<hbase-surefire.argLine>-enableassertions -Dhbase.test -Xmx${surefire.Xmx}
-XX:MaxPermSize=256m -Djava.security.egd=file:/dev/./urandom -Djava.net.preferIPv4Stack=true -XX:MaxPermSize=256m -Djava.security.egd=file:/dev/./urandom -Djava.net.preferIPv4Stack=true
-Djava.awt.headless=true -Djava.awt.headless=true
</hbase-surefire.argLine> </hbase-surefire.argLine>