Skip to content

Commit 9b89bab

Browse files
dmcppcheckclaude
andcommitted
donate-cpu-server-rest: show "Crash/Assertion failure" for the old version if head has an assertion failure
There is no stack trace for the old version, so when both versions crash and head has an assertion failure, the old version might have the same assertion failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 90b7cd1 commit 9b89bab

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

‎test/tools/donate_cpu_server_rest_test.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,16 @@ def test_crash_report_assertion(client):
152152
assert [(p['package'], p['head_assert']) for p in crash['packages']] == [('aaa', False), ('bbb', True)]
153153
page = client.get('/crash.html').text
154154
assert page.count('>Assert failed<') == 1
155+
assert '>Crash/Assertion failure<' not in page
156+
157+
158+
def test_crash_report_old_crash_assertion(client):
159+
# old version crashed too => it might be the same assertion failure
160+
result = RESULT_CRASH_ASSERTION.replace('count: Crash! 5', 'count: Crash! Crash!')
161+
assert client.post('/api/v1/results', content=result).status_code == 201
162+
page = client.get('/crash.html').text
163+
assert page.count('>Assert failed<') == 1
164+
assert page.count('>Crash/Assertion failure<') == 1
155165
assert "Variable::arrayDimensions(const Settings&amp;, bool&amp;): Assertion `x == 1&#39; failed." in page
156166

157167

‎tools/donate-cpu-server-rest.py‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1417,7 +1417,13 @@ def head_text(r: Dict[str, Any]) -> str:
14171417
if r.get('head_assert'):
14181418
return 'Assert failed'
14191419
return 'Crash' if r['head_crash'] else ''
1420-
rows = [[package_link(r['package']), r['date'], 'Crash' if r['old_crash'] else '', head_text(r)]
1420+
1421+
def old_text(r: Dict[str, Any]) -> str:
1422+
if not r['old_crash']:
1423+
return ''
1424+
# there is no stack trace for the old version, it might be the same assertion failure as in head
1425+
return 'Crash/Assertion failure' if r.get('head_assert') else 'Crash'
1426+
rows = [[package_link(r['package']), r['date'], old_text(r), head_text(r)]
14211427
for r in data['packages']]
14221428
blocks = []
14231429
for n, g in enumerate(data['stack_traces'], 1):

0 commit comments

Comments
 (0)