Skip to content

Commit dd58472

Browse files
mi-acCommit Bot
authored andcommitted
[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/+/2262915 Reviewed-by: Maya Lekova <[email protected]> Reviewed-by: Tamer Tas <[email protected]> Commit-Queue: Michael Achenbach <[email protected]> Cr-Commit-Position: refs/heads/master@{#68510}
1 parent 6015e3a commit dd58472

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

tools/clusterfuzz/v8_commands.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@
4040
ARCH_MOCKS = os.path.join(BASE_PATH, 'v8_mock_archs.js')
4141
WEBASSEMBLY_MOCKS = os.path.join(BASE_PATH, 'v8_mock_webassembly.js')
4242

43-
# Timeout in seconds for one d8 run.
44-
TIMEOUT = 3
45-
4643

4744
def _startup_files(options):
4845
"""Default files and optional config-specific mock files."""
@@ -70,7 +67,7 @@ def __init__(self, options, label, executable, config_flags):
7067

7168
self.files = _startup_files(options)
7269

73-
def run(self, testcase, verbose=False):
70+
def run(self, testcase, timeout, verbose=False):
7471
"""Run the executable with a specific testcase."""
7572
args = [self.executable] + self.flags + self.files + [testcase]
7673
if verbose:
@@ -82,7 +79,7 @@ def run(self, testcase, verbose=False):
8279
return Execute(
8380
args,
8481
cwd=os.path.dirname(os.path.abspath(testcase)),
85-
timeout=TIMEOUT,
82+
timeout=timeout,
8683
)
8784

8885
@property

tools/clusterfuzz/v8_foozzie.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@
9494
BASE_PATH = os.path.dirname(os.path.abspath(__file__))
9595
SANITY_CHECKS = os.path.join(BASE_PATH, 'v8_sanity_checks.js')
9696

97+
# Timeout for one d8 run.
98+
SANITY_CHECK_TIMEOUT_SEC = 1
99+
TEST_TIMEOUT_SEC = 3
100+
97101
SUPPORTED_ARCHS = ['ia32', 'x64', 'arm', 'arm64']
98102

99103
# Output for suppressed failure case.
@@ -387,8 +391,20 @@ def main():
387391
# Sanity checks. Run both configurations with the sanity-checks file only and
388392
# bail out early if different.
389393
if not options.skip_sanity_checks:
390-
first_config_output = first_cmd.run(SANITY_CHECKS)
391-
second_config_output = second_cmd.run(SANITY_CHECKS)
394+
first_config_output = first_cmd.run(
395+
SANITY_CHECKS, timeout=SANITY_CHECK_TIMEOUT_SEC)
396+
397+
# Early bailout if first run was a timeout.
398+
if timeout_bailout(first_config_output, 1):
399+
return RETURN_PASS
400+
401+
second_config_output = second_cmd.run(
402+
SANITY_CHECKS, timeout=SANITY_CHECK_TIMEOUT_SEC)
403+
404+
# Bailout if second run was a timeout.
405+
if timeout_bailout(second_config_output, 2):
406+
return RETURN_PASS
407+
392408
difference, _ = suppress.diff(first_config_output, second_config_output)
393409
if difference:
394410
# Special source key for sanity checks so that clusterfuzz dedupes all
@@ -399,13 +415,15 @@ def main():
399415
first_config_output, second_config_output, difference)
400416
return RETURN_FAIL
401417

402-
first_config_output = first_cmd.run(options.testcase, verbose=True)
418+
first_config_output = first_cmd.run(
419+
options.testcase, timeout=TEST_TIMEOUT_SEC, verbose=True)
403420

404421
# Early bailout if first run was a timeout.
405422
if timeout_bailout(first_config_output, 1):
406423
return RETURN_PASS
407424

408-
second_config_output = second_cmd.run(options.testcase, verbose=True)
425+
second_config_output = second_cmd.run(
426+
options.testcase, timeout=TEST_TIMEOUT_SEC, verbose=True)
409427

410428
# Bailout if second run was a timeout.
411429
if timeout_bailout(second_config_output, 2):

0 commit comments

Comments
 (0)