Commit dd584721 authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

[foozzie] Bail out on timeouts during validity checks

If we pass flags that make runs very slow, also the validity checks
might time out. Previously this wasn't checked and output was just
cut off.

This also tightens the timeout on validity checks as they are
expected to run very fast.

No-Try: true
Bug: chromium:1098646
Change-Id: Iea9a932be86e84040b72a2311aaa1d44100b3378
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2262915Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Reviewed-by: 's avatarTamer Tas <tmrts@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68510}
parent 6015e3a7
......@@ -40,9 +40,6 @@ JS_SUPPRESSIONS = os.path.join(BASE_PATH, 'v8_suppressions.js')
ARCH_MOCKS = os.path.join(BASE_PATH, 'v8_mock_archs.js')
WEBASSEMBLY_MOCKS = os.path.join(BASE_PATH, 'v8_mock_webassembly.js')
# Timeout in seconds for one d8 run.
TIMEOUT = 3
def _startup_files(options):
"""Default files and optional config-specific mock files."""
......@@ -70,7 +67,7 @@ class Command(object):
self.files = _startup_files(options)
def run(self, testcase, verbose=False):
def run(self, testcase, timeout, verbose=False):
"""Run the executable with a specific testcase."""
args = [self.executable] + self.flags + self.files + [testcase]
if verbose:
......@@ -82,7 +79,7 @@ class Command(object):
return Execute(
args,
cwd=os.path.dirname(os.path.abspath(testcase)),
timeout=TIMEOUT,
timeout=timeout,
)
@property
......
......@@ -94,6 +94,10 @@ RETURN_FAIL = 2
BASE_PATH = os.path.dirname(os.path.abspath(__file__))
SANITY_CHECKS = os.path.join(BASE_PATH, 'v8_sanity_checks.js')
# Timeout for one d8 run.
SANITY_CHECK_TIMEOUT_SEC = 1
TEST_TIMEOUT_SEC = 3
SUPPORTED_ARCHS = ['ia32', 'x64', 'arm', 'arm64']
# Output for suppressed failure case.
......@@ -387,8 +391,20 @@ def main():
# Sanity checks. Run both configurations with the sanity-checks file only and
# bail out early if different.
if not options.skip_sanity_checks:
first_config_output = first_cmd.run(SANITY_CHECKS)
second_config_output = second_cmd.run(SANITY_CHECKS)
first_config_output = first_cmd.run(
SANITY_CHECKS, timeout=SANITY_CHECK_TIMEOUT_SEC)
# Early bailout if first run was a timeout.
if timeout_bailout(first_config_output, 1):
return RETURN_PASS
second_config_output = second_cmd.run(
SANITY_CHECKS, timeout=SANITY_CHECK_TIMEOUT_SEC)
# Bailout if second run was a timeout.
if timeout_bailout(second_config_output, 2):
return RETURN_PASS
difference, _ = suppress.diff(first_config_output, second_config_output)
if difference:
# Special source key for sanity checks so that clusterfuzz dedupes all
......@@ -399,13 +415,15 @@ def main():
first_config_output, second_config_output, difference)
return RETURN_FAIL
first_config_output = first_cmd.run(options.testcase, verbose=True)
first_config_output = first_cmd.run(
options.testcase, timeout=TEST_TIMEOUT_SEC, verbose=True)
# Early bailout if first run was a timeout.
if timeout_bailout(first_config_output, 1):
return RETURN_PASS
second_config_output = second_cmd.run(options.testcase, verbose=True)
second_config_output = second_cmd.run(
options.testcase, timeout=TEST_TIMEOUT_SEC, verbose=True)
# Bailout if second run was a timeout.
if timeout_bailout(second_config_output, 2):
......
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