From 8f8ab6fa57461df3b3d8a914ddd9e39bc6ab9ad9 Mon Sep 17 00:00:00 2001 From: Alexis Campailla Date: Tue, 7 Jul 2015 22:48:26 +0200 Subject: [PATCH] test: runner should return 0 on flaky tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make the test runner return a 0 exit code when only flaky tests fail and --flaky-tests=dontcare is specified. Ported from https://github.com/joyent/node/commit/a9b642cf5b539e1b86698465d3d0b941d84c5352 PR-URL: https://github.com/nodejs/node/pull/2424 Reviewed-By: Ben Noordhuis Reviewed-By: João Reis Reviewed-By: Sakthipriyan Vairamani --- tools/test.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/test.py b/tools/test.py index 747bd499160fbd..27a06761a1c8f6 100755 --- a/tools/test.py +++ b/tools/test.py @@ -75,7 +75,9 @@ def __init__(self, cases, flaky_tests_mode): self.remaining = len(cases) self.total = len(cases) self.failed = [ ] + self.flaky_failed = [ ] self.crashed = 0 + self.flaky_crashed = 0 self.lock = threading.Lock() self.shutdown_event = threading.Event() @@ -143,9 +145,14 @@ def RunSingle(self, parallel, thread_id): return self.lock.acquire() if output.UnexpectedOutput(): - self.failed.append(output) - if output.HasCrashed(): - self.crashed += 1 + if FLAKY in output.test.outcomes and self.flaky_tests_mode == DONTCARE: + self.flaky_failed.append(output) + if output.HasCrashed(): + self.flaky_crashed += 1 + else: + self.failed.append(output) + if output.HasCrashed(): + self.crashed += 1 else: self.succeeded += 1 self.remaining -= 1