Skip to content

Commit

Permalink
Bug 1671725 - [puppeteer] Avoid recording second test status after ti…
Browse files Browse the repository at this point in the history
…meout r=remote-protocol-reviewers,whimboo

This prevents intermittent orange jobs where an additional test result is
counted after the test has already ended.

Differential Revision: https://phabricator.services.mozilla.com/D94362
  • Loading branch information
mjzffr committed Oct 22, 2020
1 parent 116e289 commit 239b7b4
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions remote/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,15 +262,27 @@ def process_event(self, event):
known_intermittent = expected[1:]
expected_status = expected[0]

self.test_results[test_name] = status
# check if we've seen a result for this test before this log line
result_recorded = self.test_results.get(test_name)
if result_recorded:
self.logger.warning(
"Received a second status for {}: "
"first {}, now {}".format(
test_name,
result_recorded,
status)
)
# mocha intermittently logs an additional test result after the
# test has already timed out. Avoid recording this second status.
if result_recorded != "TIMEOUT":
self.test_results[test_name] = status
if status not in expected:
self.has_unexpected = True
self.logger.test_end(test_name,
status=status,
expected=expected_status,
known_intermittent=known_intermittent)

if status not in expected:
self.has_unexpected = True

def new_expected(self):
new_expected = OrderedDict()
for test_name, status in iteritems(self.test_results):
Expand Down

0 comments on commit 239b7b4

Please sign in to comment.