[test] Support predictable with test processors

Bug: v8:6917
Change-Id: I36b7ef75d34f9dfee20cba09d55063d816334293
Reviewed-on: https://chromium-review.googlesource.com/887021
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michał Majewski <majeski@google.com>
Cr-Commit-Position: refs/heads/master@{#50872}
This commit is contained in:
Michal Majewski 2018-01-25 16:38:11 +01:00 committed by Commit Bot
parent 88c8bf2e71
commit 084b0e763e
2 changed files with 8 additions and 4 deletions

View File

@ -585,7 +585,11 @@ class StandardTestRunner(base_runner.BaseTestRunner):
tests_counter = TestsCounter()
results = ResultsTracker()
indicators = progress_indicator.ToProgressIndicatorProcs()
execproc = ExecutionProc(jobs, context)
outproc_factory = None
if self.build_config.predictable:
outproc_factory = predictable.get_outproc
execproc = ExecutionProc(jobs, context, outproc_factory)
procs = [
loader,

View File

@ -45,10 +45,11 @@ class ExecutionProc(base.TestProc):
sends results to the previous processor.
"""
def __init__(self, jobs, context):
def __init__(self, jobs, context, outproc_factory=None):
super(ExecutionProc, self).__init__()
self._pool = pool.Pool(jobs)
self._context = context
self._outproc_factory = outproc_factory or (lambda t: t.output_proc)
self._tests = {}
def connect_to(self, next_proc):
@ -85,8 +86,7 @@ class ExecutionProc(base.TestProc):
cmd = test.get_command(self._context)
self._tests[test_id] = test, cmd
# TODO(majeski): Needs factory for outproc as in local/execution.py
outproc = test.output_proc
outproc = self._outproc_factory(test)
self._pool.add([Job(test_id, cmd, outproc, test.keep_output)])
def result_for(self, test, result):