Skip to content

Commit

Permalink
test: runner should return 0 on flaky tests
Browse files Browse the repository at this point in the history
Make the test runner return a 0 exit code when only
flaky tests fail and --flaky-tests=dontcare is specified.

Ported from nodejs/node-v0.x-archive@a9b642c

PR-URL: #2424
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: João Reis <reis@janeasystems.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
  • Loading branch information
orangemocha authored and rvagg committed Aug 28, 2015
1 parent 0cfd3be commit 8f8ab6f
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tools/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8f8ab6f

Please sign in to comment.