Skip to content

Commit

Permalink
Adjust bug suggestions path when there is a crash (#7738)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmaher committed Jul 13, 2023
1 parent 49aa450 commit 3151de1
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 16 deletions.
25 changes: 13 additions & 12 deletions tests/model/test_error_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,25 +80,25 @@ def test_get_cleaned_line(line_raw, exp_line_cleaned):
(
(
"REFTEST PROCESS-CRASH "
"| application crashed [@ jemalloc_crash] "
"| http://10.0.2.2:8854/tests/dom/canvas/test/reftest/webgl-resize-test.html == "
"http://10.0.2.2:8854/tests/dom/canvas/test/reftest/wrapper.html?green.png "
"| application crashed [@ jemalloc_crash]"
"http://10.0.2.2:8854/tests/dom/canvas/test/reftest/wrapper.html?green.png"
),
{
'path_end': 'http://10.0.2.2:8854/tests/dom/canvas/test/reftest/webgl-resize-test.html',
'search_term': ['webgl-resize-test.html'],
'search_term': ['application crashed [@ jemalloc_crash]'],
},
),
(
(
"REFTEST PROCESS-CRASH "
"| application crashed [@ jemalloc_crash] "
"| http://10.0.2.2:8854/tests/dom/canvas/test/reftest/webgl-resize-test.html != "
"http://10.0.2.2:8854/tests/dom/canvas/test/reftest/wrapper.html?green.png "
"| application crashed [@ jemalloc_crash]"
"http://10.0.2.2:8854/tests/dom/canvas/test/reftest/wrapper.html?green.png"
),
{
'path_end': 'http://10.0.2.2:8854/tests/dom/canvas/test/reftest/webgl-resize-test.html',
'search_term': ['webgl-resize-test.html'],
'search_term': ['application crashed [@ jemalloc_crash]'],
},
),
(
Expand Down Expand Up @@ -277,9 +277,9 @@ def test_get_long_search_term(line, exp_search_info):
CRASH_LINE_TEST_CASES = (
(
(
'PROCESS-CRASH | file:///C:/slave/test/build/tests/jsreftest/tests/'
'jsreftest.html?test=test262/ch11/11.4/11.4.1/11.4.1-4.a-6.js | '
'application crashed [@ nsInputStreamPump::OnStateStop()]'
'PROCESS-CRASH | application crashed [@ nsInputStreamPump::OnStateStop()] | '
'file:///C:/slave/test/build/tests/jsreftest/tests/'
'jsreftest.html?test=test262/ch11/11.4/11.4.1/11.4.1-4.a-6.js'
),
'nsInputStreamPump::OnStateStop()',
),
Expand Down Expand Up @@ -312,12 +312,13 @@ def test_get_crash_signature(line, exp_search_info):
),
(
(
'REFTEST PROCESS-CRASH | file:///home/worker/workspace/build/tests/reftest/tests/layout/reftests/font-inflation/video-1.html '
'| application crashed [@ mozalloc_abort]'
'REFTEST PROCESS-CRASH '
'| application crashed [@ mozalloc_abort] '
'| file:///home/worker/workspace/build/tests/reftest/tests/layout/reftests/font-inflation/video-1.html'
),
{
'path_end': 'file:///home/worker/workspace/build/tests/reftest/tests/layout/reftests/font-inflation/video-1.html',
'search_term': ['video-1.html'],
'search_term': ['application crashed [@ mozalloc_abort]'],
},
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
{
"linenumber": 829,
"line": "12:46:37 WARNING - PROCESS-CRASH | automation.py | application crashed [@ xOpen]"
"line": "12:46:37 WARNING - PROCESS-CRASH | application crashed [@ xOpen] | automation.py"
},
{
"linenumber": 1600,
Expand All @@ -27,7 +27,7 @@
},
{
"linenumber": 1636,
"line": "12:46:46 WARNING - PROCESS-CRASH | automation.py | application crashed [@ xOpen]"
"line": "12:46:46 WARNING - PROCESS-CRASH | application crashed [@ xOpen] | automation.py"
},
{
"linenumber": 2283,
Expand All @@ -43,7 +43,7 @@
},
{
"linenumber": 2319,
"line": "12:46:55 WARNING - PROCESS-CRASH | automation.py | application crashed [@ xOpen]"
"line": "12:46:55 WARNING - PROCESS-CRASH | application crashed [@ xOpen] | automation.py"
},
{
"linenumber": 3062,
Expand Down
Binary file not shown.
8 changes: 7 additions & 1 deletion treeherder/model/error_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
LINE_CACHE_TIMEOUT = 86400 * LINE_CACHE_TIMEOUT_DAYS

LEAK_RE = re.compile(r'\d+ bytes leaked \((.+)\)$|leak at (.+)$')
CRASH_RE = re.compile(r'.+ application crashed \[@ (.+)\]$')
CRASH_RE = re.compile(r'.+ application crashed \[@ (.+)\] \|.+')
MOZHARNESS_RE = re.compile(r'^\d+:\d+:\d+[ ]+(?:DEBUG|INFO|WARNING|ERROR|CRITICAL|FATAL) - [ ]?')
PROCESS_ID_RE = re.compile(r"(?:PID \d+|GECKO\(\d+\)) \| +")
REFTEST_RE = re.compile(r'\s+[=!]=\s+.*')
Expand Down Expand Up @@ -216,9 +216,13 @@ def get_error_search_term_and_path(error_line):
path_end = None

if len(tokens) >= 3:
is_crash = 'PROCESS-CRASH' in tokens[0]
# it's in the "FAILURE-TYPE | testNameOrFilePath | message" type format.
test_name_or_path = tokens[1]
message = tokens[2]
if is_crash:
test_name_or_path = tokens[2]
message = tokens[1]
# Leak failure messages are of the form:
# leakcheck | .*\d+ bytes leaked (Object-1, Object-2, Object-3, ...)
match = LEAK_RE.search(message)
Expand All @@ -231,6 +235,8 @@ def get_error_search_term_and_path(error_line):
path_end = test_name_or_path
# if this is a path, we are interested in the last part
search_term = test_name_or_path.split("/")[-1]
if is_crash:
search_term = message

# If the failure line was not in the pipe symbol delimited format or the search term
# will likely return too many (or irrelevant) results (eg: too short or matches terms
Expand Down

0 comments on commit 3151de1

Please sign in to comment.