HBASE-18341 Generalize regex matchers in findHangingTests.py script to match new consoleText of trunk build.

Change-Id: I0a4215827d3d561eef3f583da666c617f690d934
This commit is contained in:
Apekshit Sharma 2017-07-08 00:49:31 -07:00
parent 30d06dfe3a
commit 590f02aad0
1 changed files with 6 additions and 6 deletions

View File

@ -60,18 +60,18 @@ def get_bad_tests(console_url):
failed_tests_set = set() failed_tests_set = set()
timeout_tests_set = set() timeout_tests_set = set()
for line in response.content.splitlines(): for line in response.content.splitlines():
result1 = re.match("^Running org.apache.hadoop.hbase.(\\w*\\.)*(\\w*)", line) result1 = re.findall("Running org.apache.hadoop.hbase.(.*)", line)
if result1: if len(result1) == 1:
test_case = result1.group(2) test_case = result1[0]
if test_case in all_tests_set: if test_case in all_tests_set:
print ("ERROR! Multiple tests with same name '{}'. Might get wrong results " print ("ERROR! Multiple tests with same name '{}'. Might get wrong results "
"for this test.".format(test_case)) "for this test.".format(test_case))
else: else:
hanging_tests_set.add(test_case) hanging_tests_set.add(test_case)
all_tests_set.add(test_case) all_tests_set.add(test_case)
result2 = re.match("^Tests run:.*- in org.apache.hadoop.hbase.(\\w*\\.)*(\\w*)", line) result2 = re.findall("Tests run:.*?- in org.apache.hadoop.hbase.(.*)", line)
if result2: if len(result2) == 1:
test_case = result2.group(2) test_case = result2[0]
if "FAILURE!" in line: if "FAILURE!" in line:
failed_tests_set.add(test_case) failed_tests_set.add(test_case)
if test_case not in hanging_tests_set: if test_case not in hanging_tests_set: