diff options
Diffstat (limited to 'deps/v8/tools/testrunner')
-rw-r--r-- | deps/v8/tools/testrunner/OWNERS | 4 | ||||
-rw-r--r-- | deps/v8/tools/testrunner/base_runner.py | 27 | ||||
-rw-r--r-- | deps/v8/tools/testrunner/local/command.py | 9 | ||||
-rw-r--r-- | deps/v8/tools/testrunner/local/junit_output.py | 49 | ||||
-rw-r--r-- | deps/v8/tools/testrunner/local/variants.py | 4 | ||||
-rw-r--r-- | deps/v8/tools/testrunner/objects/output.py | 16 | ||||
-rw-r--r-- | deps/v8/tools/testrunner/objects/testcase.py | 9 | ||||
-rwxr-xr-x | deps/v8/tools/testrunner/standard_runner.py | 5 | ||||
-rw-r--r-- | deps/v8/tools/testrunner/testproc/progress.py | 63 |
9 files changed, 72 insertions, 114 deletions
diff --git a/deps/v8/tools/testrunner/OWNERS b/deps/v8/tools/testrunner/OWNERS index c8693c972c..50b5741785 100644 --- a/deps/v8/tools/testrunner/OWNERS +++ b/deps/v8/tools/testrunner/OWNERS @@ -1,5 +1,3 @@ set noparent -machenbach@chromium.org -sergiyb@chromium.org -tmrts@chromium.org
\ No newline at end of file +file://INFRA_OWNERS diff --git a/deps/v8/tools/testrunner/base_runner.py b/deps/v8/tools/testrunner/base_runner.py index 5e6a3c11a5..caed59356e 100644 --- a/deps/v8/tools/testrunner/base_runner.py +++ b/deps/v8/tools/testrunner/base_runner.py @@ -185,11 +185,13 @@ class BuildConfig(object): self.is_android = build_config['is_android'] self.is_clang = build_config['is_clang'] self.is_debug = build_config['is_debug'] + self.is_full_debug = build_config['is_full_debug'] self.msan = build_config['is_msan'] self.no_i18n = not build_config['v8_enable_i18n_support'] self.no_snap = not build_config['v8_use_snapshot'] self.predictable = build_config['v8_enable_verify_predictable'] self.tsan = build_config['is_tsan'] + # TODO(machenbach): We only have ubsan not ubsan_vptr. self.ubsan_vptr = build_config['is_ubsan_vptr'] self.embedded_builtins = build_config['v8_enable_embedded_builtins'] self.verify_csa = build_config['v8_enable_verify_csa'] @@ -200,6 +202,11 @@ class BuildConfig(object): self.mips_arch_variant = build_config['mips_arch_variant'] self.mips_use_msa = build_config['mips_use_msa'] + @property + def use_sanitizer(self): + return (self.asan or self.cfi_vptr or self.msan or self.tsan or + self.ubsan_vptr) + def __str__(self): detected_options = [] @@ -341,9 +348,6 @@ class BaseTestRunner(object): "color, mono)") parser.add_option("--json-test-results", help="Path to a file for storing json results.") - parser.add_option("--junitout", help="File name of the JUnit output") - parser.add_option("--junittestsuite", default="v8tests", - help="The testsuite name in the JUnit output file") parser.add_option("--exit-after-n-failures", type="int", default=100, help="Exit after the first N failures instead of " "running all tests. Pass 0 to disable this feature.") @@ -673,6 +677,7 @@ class BaseTestRunner(object): "gcov_coverage": self.build_config.gcov_coverage, "isolates": options.isolates, "is_clang": self.build_config.is_clang, + "is_full_debug": self.build_config.is_full_debug, "mips_arch_variant": mips_arch_variant, "mode": self.mode_options.status_mode if not self.build_config.dcheck_always_on @@ -712,15 +717,18 @@ class BaseTestRunner(object): ) def _timeout_scalefactor(self, options): + """Increases timeout for slow build configurations.""" factor = self.mode_options.timeout_scalefactor - - # Simulators are slow, therefore allow a longer timeout. if self.build_config.arch in SLOW_ARCHS: + factor *= 4 + if self.build_config.lite_mode: factor *= 2 - - # Predictable mode is slower. if self.build_config.predictable: - factor *= 2 + factor *= 4 + if self.build_config.use_sanitizer: + factor *= 1.5 + if self.build_config.is_full_debug: + factor *= 4 return factor @@ -779,9 +787,6 @@ class BaseTestRunner(object): def _create_progress_indicators(self, test_count, options): procs = [PROGRESS_INDICATORS[options.progress]()] - if options.junitout: - procs.append(progress.JUnitTestProgressIndicator(options.junitout, - options.junittestsuite)) if options.json_test_results: procs.append(progress.JsonTestProgressIndicator( self.framework_name, diff --git a/deps/v8/tools/testrunner/local/command.py b/deps/v8/tools/testrunner/local/command.py index 5eb0d8b20a..b68252c139 100644 --- a/deps/v8/tools/testrunner/local/command.py +++ b/deps/v8/tools/testrunner/local/command.py @@ -129,8 +129,12 @@ class BaseCommand(object): def _abort(self, process, abort_called): abort_called[0] = True try: + print('Attempting to kill process %s' % process.pid) + sys.stdout.flush() self._kill_process(process) - except OSError: + except OSError as e: + print(e) + sys.stdout.flush() pass def __str__(self): @@ -207,9 +211,6 @@ class WindowsCommand(BaseCommand): return subprocess.list2cmdline(self._to_args_list()) def _kill_process(self, process): - if self.verbose: - print('Attempting to kill process %d' % process.pid) - sys.stdout.flush() tk = subprocess.Popen( 'taskkill /T /F /PID %d' % process.pid, stdout=subprocess.PIPE, diff --git a/deps/v8/tools/testrunner/local/junit_output.py b/deps/v8/tools/testrunner/local/junit_output.py deleted file mode 100644 index 52f31ec422..0000000000 --- a/deps/v8/tools/testrunner/local/junit_output.py +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright 2013 the V8 project authors. All rights reserved. -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -import xml.etree.ElementTree as xml - - -class JUnitTestOutput: - def __init__(self, test_suite_name): - self.root = xml.Element("testsuite") - self.root.attrib["name"] = test_suite_name - - def HasRunTest(self, test_name, test_cmd, test_duration, test_failure): - testCaseElement = xml.Element("testcase") - testCaseElement.attrib["name"] = test_name - testCaseElement.attrib["cmd"] = test_cmd - testCaseElement.attrib["time"] = str(round(test_duration, 3)) - if len(test_failure): - failureElement = xml.Element("failure") - failureElement.text = test_failure - testCaseElement.append(failureElement) - self.root.append(testCaseElement) - - def FinishAndWrite(self, f): - xml.ElementTree(self.root).write(f, "UTF-8") diff --git a/deps/v8/tools/testrunner/local/variants.py b/deps/v8/tools/testrunner/local/variants.py index ed9b1b87f5..dc92db6099 100644 --- a/deps/v8/tools/testrunner/local/variants.py +++ b/deps/v8/tools/testrunner/local/variants.py @@ -23,7 +23,9 @@ ALL_VARIANT_FLAGS = { "slow_path": [["--force-slow-path"]], "stress": [["--stress-opt", "--always-opt", "--no-liftoff", "--no-wasm-tier-up"]], - "stress_background_compile": [["--stress-background-compile"]], + "stress_js_bg_compile_wasm_code_gc": [["--stress-background-compile", + "--wasm-code-gc", + "--stress-wasm-code-gc"]], "stress_incremental_marking": [["--stress-incremental-marking"]], # Trigger stress sampling allocation profiler with sample interval = 2^14 "stress_sampling": [["--stress-sampling-allocation-profiler=16384"]], diff --git a/deps/v8/tools/testrunner/objects/output.py b/deps/v8/tools/testrunner/objects/output.py index 74cec56a85..78aa63d4c9 100644 --- a/deps/v8/tools/testrunner/objects/output.py +++ b/deps/v8/tools/testrunner/objects/output.py @@ -34,7 +34,8 @@ from ..local import utils class Output(object): - def __init__(self, exit_code, timed_out, stdout, stderr, pid, duration): + def __init__(self, exit_code=0, timed_out=False, stdout=None, stderr=None, + pid=None, duration=None): self.exit_code = exit_code self.timed_out = timed_out self.stdout = stdout @@ -61,3 +62,16 @@ class Output(object): def HasTimedOut(self): return self.timed_out + + def IsSuccess(self): + return not self.HasCrashed() and not self.HasTimedOut() + + +class _NullOutput(Output): + """Useful to signal that the binary has not been run.""" + def __init__(self): + super(_NullOutput, self).__init__() + + +# Default instance of the _NullOutput class above. +NULL_OUTPUT = _NullOutput() diff --git a/deps/v8/tools/testrunner/objects/testcase.py b/deps/v8/tools/testrunner/objects/testcase.py index 80c7c29ed1..6d4dcd1352 100644 --- a/deps/v8/tools/testrunner/objects/testcase.py +++ b/deps/v8/tools/testrunner/objects/testcase.py @@ -244,13 +244,16 @@ class TestCase(object): timeout = self._test_config.timeout if "--stress-opt" in params: timeout *= 4 + if "--jitless" in params: + timeout *= 2 + if "--no-opt" in params: + timeout *= 2 if "--noenable-vfp3" in params: timeout *= 2 if self._get_timeout_param() == TIMEOUT_LONG: timeout *= 10 - - # TODO(majeski): make it slow outcome dependent. - timeout *= 2 + if self.is_slow: + timeout *= 4 return timeout def get_shell(self): diff --git a/deps/v8/tools/testrunner/standard_runner.py b/deps/v8/tools/testrunner/standard_runner.py index 2a08d2d97e..bc79c015bd 100755 --- a/deps/v8/tools/testrunner/standard_runner.py +++ b/deps/v8/tools/testrunner/standard_runner.py @@ -34,7 +34,7 @@ VARIANTS = ['default'] MORE_VARIANTS = [ 'jitless', 'stress', - 'stress_background_compile', + 'stress_js_bg_compile_wasm_code_gc', 'stress_incremental_marking', ] @@ -53,7 +53,8 @@ GC_STRESS_FLAGS = ['--gc-interval=500', '--stress-compaction', '--concurrent-recompilation-queue-length=64', '--concurrent-recompilation-delay=500', '--concurrent-recompilation', - '--stress-flush-bytecode'] + '--stress-flush-bytecode', + '--wasm-code-gc', '--stress-wasm-code-gc'] RANDOM_GC_STRESS_FLAGS = ['--random-gc-interval=5000', '--stress-compaction-random'] diff --git a/deps/v8/tools/testrunner/testproc/progress.py b/deps/v8/tools/testrunner/testproc/progress.py index 12d9503088..aad6740c1c 100644 --- a/deps/v8/tools/testrunner/testproc/progress.py +++ b/deps/v8/tools/testrunner/testproc/progress.py @@ -7,11 +7,17 @@ from __future__ import print_function import json import os +import platform +import subprocess import sys import time from . import base -from ..local import junit_output + + +# Base dir of the build products for Release and Debug. +OUT_DIR = os.path.abspath( + os.path.join(os.path.dirname(__file__), '..', '..', '..', 'out')) def print_failure_header(test): @@ -121,11 +127,27 @@ class VerboseProgressIndicator(SimpleProgressIndicator): self._print('Done running %s %s: %s' % ( test, test.variant or 'default', outcome)) + # TODO(machenbach): Remove this platform specific hack and implement a proper + # feedback channel from the workers, providing which tests are currently run. + def _print_processes_linux(self): + if platform.system() == 'Linux': + try: + cmd = 'ps -aux | grep "%s"' % OUT_DIR + output = subprocess.check_output(cmd, shell=True) + self._print('List of processes:') + for line in (output or '').splitlines(): + # Show command with pid, but other process info cut off. + self._print('pid: %s cmd: %s' % + (line.split()[1], line[line.index(OUT_DIR):])) + except: + pass + def _on_heartbeat(self): if time.time() - self._last_printed_time > 30: # Print something every 30 seconds to not get killed by an output # timeout. self._print('Still working...') + self._print_processes_linux() class DotsProgressIndicator(SimpleProgressIndicator): @@ -259,45 +281,6 @@ class MonochromeProgressIndicator(CompactProgressIndicator): print(("\r" + (" " * last_length) + "\r"), end='') -class JUnitTestProgressIndicator(ProgressIndicator): - def __init__(self, junitout, junittestsuite): - super(JUnitTestProgressIndicator, self).__init__() - self._requirement = base.DROP_PASS_STDOUT - - self.outputter = junit_output.JUnitTestOutput(junittestsuite) - if junitout: - self.outfile = open(junitout, "w") - else: - self.outfile = sys.stdout - - def _on_result_for(self, test, result): - # TODO(majeski): Support for dummy/grouped results - fail_text = "" - output = result.output - if result.has_unexpected_output: - stdout = output.stdout.strip() - if len(stdout): - fail_text += "stdout:\n%s\n" % stdout - stderr = output.stderr.strip() - if len(stderr): - fail_text += "stderr:\n%s\n" % stderr - fail_text += "Command: %s" % result.cmd.to_string() - if output.HasCrashed(): - fail_text += "exit code: %d\n--- CRASHED ---" % output.exit_code - if output.HasTimedOut(): - fail_text += "--- TIMEOUT ---" - self.outputter.HasRunTest( - test_name=str(test), - test_cmd=result.cmd.to_string(relative=True), - test_duration=output.duration, - test_failure=fail_text) - - def finished(self): - self.outputter.FinishAndWrite(self.outfile) - if self.outfile != sys.stdout: - self.outfile.close() - - class JsonTestProgressIndicator(ProgressIndicator): def __init__(self, framework_name, json_test_results, arch, mode): super(JsonTestProgressIndicator, self).__init__() |