Skip to content

Commit

Permalink
Bug 1605731 - Fix assertion in mach formatter with multiple repetitio…
Browse files Browse the repository at this point in the history
…ns of suite, r=ahal

When we run a suite more than once we can get more than one result for
a test. Iterate over all results when writing the summary rather than
erroring out in this case.

Probably a better solution would be to only write the result from the
current run, but we don't necessarily know what that is, since it's
not tracked by the SummaryHandler.

Differential Revision: https://phabricator.services.mozilla.com/D58133
  • Loading branch information
jgraham committed Jan 2, 2020
1 parent efb5e1a commit ef90cd4
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions testing/mozbase/mozlog/mozlog/formatters/machformatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,9 @@ def _format_suite_summary(self, suite, summary):
else:
for test_id, results in intermittent_logs.items():
test = self._get_file_name(test_id)
assert len(results) == 1
data = results[0]
assert "subtest" not in data
rv.append(self._format_status(test, data).rstrip())
for data in results:
assert "subtest" not in data
rv.append(self._format_status(test, data).rstrip())

# Format status
testfailed = any(count[key]["unexpected"] for key in ('test', 'subtest', 'assert'))
Expand All @@ -252,10 +251,9 @@ def _format_suite_summary(self, suite, summary):
else:
for test_id, results in logs.items():
test = self._get_file_name(test_id)
assert len(results) == 1
data = results[0]
assert "subtest" not in data
rv.append(self._format_status(test, data).rstrip())
for data in results:
assert "subtest" not in data
rv.append(self._format_status(test, data).rstrip())

# Format harness errors
if harness_errors:
Expand Down

0 comments on commit ef90cd4

Please sign in to comment.