Bug 1521191, part 2 - Ensure missing leak logs cause mozharness to fail. r=ahal

Depends on D17534

Differential Revision: https://phabricator.services.mozilla.com/D17535

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrew McCreight 2019-01-25 20:27:34 +00:00
parent 0eb5d04802
commit 16351e63ce
3 changed files with 41 additions and 1 deletions

View File

@ -0,0 +1,25 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1343659
-->
<head>
<meta charset="utf-8">
<title>Test Crash</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
SpecialPowers.Cu.disableDumpStatistics();
ok(true, "Test is ok");
</script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1343659">Mozilla Bug 1343659</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
</html>

View File

@ -127,5 +127,15 @@ def test_output_leak(runtests):
assert found_leaks, "At least one process should have leaked"
@pytest.mark.skip_mozinfo("!debug")
def test_output_no_leak_log(runtests):
status, lines = runtests('test_no_leak_log.html')
assert status == 0
tbpl_status, log_level, summary = get_mozharness_status(lines, status)
assert tbpl_status == TBPL_WARNING
assert log_level == WARNING
if __name__ == '__main__':
mozunit.main()

View File

@ -68,7 +68,12 @@ class StatusHandler(object):
self.unexpected_statuses["FAIL"] += 1
if action == "mozleak_total":
if data.get("bytes", 0) > data.get("threshold", 0):
data_bytes = data["bytes"]
if data_bytes is None:
if not (data.get("induced_crash", False) or
data.get("ignore_missing", False)):
self.unexpected_statuses["FAIL"] += 1
elif data_bytes > data.get("threshold", 0):
self.unexpected_statuses["FAIL"] += 1
def summarize(self):