HBASE-16038 Ignore JVM crashes or machine shutdown failures in report-flakies.
Change-Id: If49acd704e827b289c75f449a6180038b297d647 Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/f283ff01 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/f283ff01 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/f283ff01 Branch: refs/heads/hbase-12439 Commit: f283ff01aa52a810e81553dfb67edd5d2fab5ddf Parents: 1bad166 Author: Apekshit Sharma <[email protected]> Authored: Wed Jun 15 15:39:49 2016 -0700 Committer: Apekshit Sharma <[email protected]> Committed: Wed Jun 15 16:01:49 2016 -0700 ---------------------------------------------------------------------- dev-support/findHangingTests.py | 18 +++++++++++++++++- dev-support/report-flakies.py | 6 +++++- 2 files changed, 22 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/f283ff01/dev-support/findHangingTests.py ---------------------------------------------------------------------- diff --git a/dev-support/findHangingTests.py b/dev-support/findHangingTests.py index 28f4895..c906125 100755 --- a/dev-support/findHangingTests.py +++ b/dev-support/findHangingTests.py @@ -23,6 +23,14 @@ import re import requests import sys + +# If any of these strings appear in the console output, it's a build one should probably ignore +# for analyzing failed/hanging tests. +BAD_RUN_STRINGS = [ + "Slave went offline during the build", # Machine went down, can't do anything about it. + "The forked VM terminated without properly saying goodbye", # JVM crashed. +] + # Returns [[all tests], [failed tests], [timeout tests], [hanging tests]] # Definitions: # All tests: All testcases which were run. @@ -66,6 +74,10 @@ def get_bad_tests(console_url): if result3: test_case = result3.group(1) timeout_tests.add(test_case) + for bad_string in BAD_RUN_STRINGS: + if re.match(".*" + bad_string + ".*", line): + print "Bad string found in build:\n > {}".format(line) + return print "Result > total tests: {:4} failed : {:4} timedout : {:4} hanging : {:4}".format( len(all_tests), len(failed_tests), len(timeout_tests), len(hanging_tests)) return [all_tests, failed_tests, timeout_tests, hanging_tests] @@ -76,7 +88,11 @@ if __name__ == "__main__": sys.exit(1) print "Fetching {}".format(sys.argv[1]) - [all_tests, failed_tests, timedout_tests, hanging_tests] = get_bad_tests(sys.argv[1]) + result = get_bad_tests(sys.argv[1]) + if not result: + sys.exit(1) + [all_tests, failed_tests, timedout_tests, hanging_tests] = result + print "Found {} hanging tests:".format(len(hanging_tests)) for test in hanging_tests: print test http://git-wip-us.apache.org/repos/asf/hbase/blob/f283ff01/dev-support/report-flakies.py ---------------------------------------------------------------------- diff --git a/dev-support/report-flakies.py b/dev-support/report-flakies.py index 676eca3..20467e7 100755 --- a/dev-support/report-flakies.py +++ b/dev-support/report-flakies.py @@ -55,7 +55,11 @@ def get_bad_tests(build_url): logger.info("Skipping this build since it is in progress.") return {} console_url = build_url + "/consoleText" - return findHangingTests.get_bad_tests(console_url) + result = findHangingTests.get_bad_tests(console_url) + if not result: + logger.info("Ignoring build {}".format(build_url)) + return {} + return result # If any url is of type multi-configuration project (i.e. has key 'activeConfigurations'),
