Commit 084b0e76 authored by Michal Majewski's avatar Michal Majewski Committed by Commit Bot

[test] Support predictable with test processors

Bug: v8:6917
Change-Id: I36b7ef75d34f9dfee20cba09d55063d816334293
Reviewed-on: https://chromium-review.googlesource.com/887021Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Commit-Queue: Michał Majewski <majeski@google.com>
Cr-Commit-Position: refs/heads/master@{#50872}
parent 88c8bf2e
......@@ -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,
......
......@@ -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):
......
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