Commit cd803b15 authored by machenbach's avatar machenbach Committed by Commit bot

[test] Make missing files result in a proper test runner error.

BUG=

Review URL: https://codereview.chromium.org/1652003002

Cr-Commit-Position: refs/heads/master@{#33684}
parent d582d2bb
...@@ -109,6 +109,7 @@ class Pool(): ...@@ -109,6 +109,7 @@ class Pool():
process boundary. process boundary.
""" """
try: try:
internal_error = False
gen = iter(gen) gen = iter(gen)
self.advance = self._advance_more self.advance = self._advance_more
...@@ -134,7 +135,9 @@ class Pool(): ...@@ -134,7 +135,9 @@ class Pool():
yield MaybeResult.create_heartbeat() yield MaybeResult.create_heartbeat()
self.count -= 1 self.count -= 1
if result.exception: if result.exception:
# Ignore items with unexpected exceptions. # TODO(machenbach): Handle a few known types of internal errors
# gracefully, e.g. missing test files.
internal_error = True
continue continue
elif result.break_now: elif result.break_now:
# A keyboard interrupt happened in one of the worker processes. # A keyboard interrupt happened in one of the worker processes.
...@@ -144,6 +147,8 @@ class Pool(): ...@@ -144,6 +147,8 @@ class Pool():
self.advance(gen) self.advance(gen)
finally: finally:
self.terminate() self.terminate()
if internal_error:
raise Exception("Internal error in a worker process.")
def _advance_more(self, gen): def _advance_more(self, gen):
while self.count < self.num_workers * self.BUFFER_FACTOR: while self.count < self.num_workers * self.BUFFER_FACTOR:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment