Commit df1b44b6 authored by Michal Majewski's avatar Michal Majewski Committed by Commit Bot

[test] Fix infinite loop and fail result in the num fuzzer

1. Fix infinite loop caused by time based fuzzing
2. Shallow copy of the result to avoid dropping output
by different processor.

Bug: v8:6917
Change-Id: Icf823e853be9d3cc8dfd46ed2fb954979bf02d2f
Reviewed-on: https://chromium-review.googlesource.com/877761
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: 's avatarSergiy Byelozyorov <sergiyb@chromium.org>
Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50737}
parent 69abb960
......@@ -119,7 +119,7 @@ class FuzzerProc(base.TestProcProducer):
return
i = 0
while not self._stop or i < self._count:
while (self._fuzz_duration_sec and not self._stop) or i < self._count:
main_index = self._rng.choice(indexes)
_, main_gen = gens[main_index]
......
......@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import copy
import json
import os
import sys
......@@ -69,25 +70,25 @@ class SimpleProgressIndicator(ProgressIndicator):
def _on_result_for(self, test, result):
# TODO(majeski): Support for dummy/grouped results
if result.has_unexpected_output:
self._failed.append((test, result))
self._failed.append((test, result.cmd, copy.copy(result.output)))
def finished(self):
crashed = 0
print
for test, result in self._failed:
for test, cmd, output in self._failed:
print_failure_header(test)
if result.output.stderr:
if output.stderr:
print "--- stderr ---"
print result.output.stderr.strip()
if result.output.stdout:
print output.stderr.strip()
if output.stdout:
print "--- stdout ---"
print result.output.stdout.strip()
print "Command: %s" % result.cmd.to_string()
if result.output.HasCrashed():
print "exit code: %d" % result.output.exit_code
print output.stdout.strip()
print "Command: %s" % cmd.to_string()
if output.HasCrashed():
print "exit code: %d" % output.exit_code
print "--- CRASHED ---"
crashed += 1
if result.output.HasTimedOut():
if output.HasTimedOut():
print "--- TIMEOUT ---"
if len(self._failed) == 0:
print "==="
......
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