From 239b7b4bc989e8b76db870f21ddd4f6634272b42 Mon Sep 17 00:00:00 2001 From: Maja Frydrychowicz Date: Thu, 22 Oct 2020 14:11:21 +0000 Subject: [PATCH] Bug 1671725 - [puppeteer] Avoid recording second test status after timeout 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 --- remote/mach_commands.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/remote/mach_commands.py b/remote/mach_commands.py index 665efa9535d9e..ef6c960ac098b 100644 --- a/remote/mach_commands.py +++ b/remote/mach_commands.py @@ -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):