Skip to content

Commit a9b642c

Browse files
committed
test: runner should return 0 on flaky tests
Make the test runner return a 0 exit code when only flaky tests fail and --flaky-tests=dontcare is specified. Reviewed-By: Julien Gilli <julien.gilli@joyent.com> PR-URL: nodejs/node-v0.x-archive#25653
1 parent 2d2494c commit a9b642c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

tools/test.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ def __init__(self, cases, flaky_tests_mode):
6868
self.remaining = len(cases)
6969
self.total = len(cases)
7070
self.failed = [ ]
71+
self.flaky_failed = [ ]
7172
self.crashed = 0
73+
self.flaky_crashed = 0
7274
self.terminate = False
7375
self.lock = threading.Lock()
7476

@@ -129,9 +131,14 @@ def RunSingle(self):
129131
return
130132
self.lock.acquire()
131133
if output.UnexpectedOutput():
132-
self.failed.append(output)
133-
if output.HasCrashed():
134-
self.crashed += 1
134+
if FLAKY in output.test.outcomes and self.flaky_tests_mode == "dontcare":
135+
self.flaky_failed.append(output)
136+
if output.HasCrashed():
137+
self.flaky_crashed += 1
138+
else:
139+
self.failed.append(output)
140+
if output.HasCrashed():
141+
self.crashed += 1
135142
else:
136143
self.succeeded += 1
137144
self.remaining -= 1

0 commit comments

Comments
 (0)