[test] Remove leftovers of the interrupt-budget fuzzer
TBR=sergiyb@chromium.org Bug: v8:8174, v8:8457 Change-Id: Ie87eddcc6986e1c724040b11b036b502e399dd05 Reviewed-on: https://chromium-review.googlesource.com/c/1404437 Reviewed-by: Sergiy Belozorov <sergiyb@chromium.org> Commit-Queue: Michael Achenbach <machenbach@chromium.org> Cr-Commit-Position: refs/heads/master@{#58735}
This commit is contained in:
parent
c7410e8ccf
commit
1efb130a8e
@ -1,9 +0,0 @@
|
||||
// Copyright 2018 the V8 project authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
|
||||
// This turns all mjsunit asserts into no-ops used for fuzzing.
|
||||
(function () {
|
||||
failWithMessage = function () {}
|
||||
})();
|
@ -81,9 +81,6 @@ class TestSuite(testsuite.TestSuite):
|
||||
def _test_class(self):
|
||||
return TestCase
|
||||
|
||||
def _suppressed_test_class(self):
|
||||
return SuppressedTestCase
|
||||
|
||||
|
||||
class TestCase(testcase.D8TestCase):
|
||||
def __init__(self, *args, **kwargs):
|
||||
@ -282,27 +279,5 @@ class CombinedTest(testcase.D8TestCase):
|
||||
test._get_statusfile_flags() for test in self._tests)
|
||||
|
||||
|
||||
class SuppressedTestCase(TestCase):
|
||||
"""The same as a standard mjsunit test case with all asserts as no-ops."""
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(SuppressedTestCase, self).__init__(*args, **kwargs)
|
||||
self._mjsunit_files.append(
|
||||
os.path.join(self.suite.root, "mjsunit_suppressions.js"))
|
||||
|
||||
def _prepare_outcomes(self, *args, **kwargs):
|
||||
super(SuppressedTestCase, self)._prepare_outcomes(*args, **kwargs)
|
||||
# Skip tests expected to fail. We suppress all asserts anyways, but some
|
||||
# tests are expected to fail with type errors or even dchecks, and we
|
||||
# can't differentiate that.
|
||||
if statusfile.FAIL in self._statusfile_outcomes:
|
||||
self._statusfile_outcomes = [statusfile.SKIP]
|
||||
|
||||
def _get_extra_flags(self, *args, **kwargs):
|
||||
return (
|
||||
super(SuppressedTestCase, self)._get_extra_flags(*args, **kwargs) +
|
||||
['--disable-abortjs']
|
||||
)
|
||||
|
||||
|
||||
def GetSuite(*args, **kwargs):
|
||||
return TestSuite(*args, **kwargs)
|
||||
|
@ -97,19 +97,10 @@ class TestSuite(object):
|
||||
self.test_config = test_config
|
||||
self.tests = None # list of TestCase objects
|
||||
self.statusfile = None
|
||||
self.suppress_internals = False
|
||||
|
||||
def status_file(self):
|
||||
return "%s/%s.status" % (self.root, self.name)
|
||||
|
||||
def do_suppress_internals(self):
|
||||
"""Specifies if this test suite should suppress asserts based on internals.
|
||||
|
||||
Internals are e.g. testing against the outcome of native runtime functions.
|
||||
This is switched off on some fuzzers that violate these contracts.
|
||||
"""
|
||||
self.suppress_internals = True
|
||||
|
||||
def ListTests(self):
|
||||
raise NotImplementedError
|
||||
|
||||
@ -141,20 +132,10 @@ class TestSuite(object):
|
||||
self.tests = self.ListTests()
|
||||
|
||||
def _create_test(self, path, **kwargs):
|
||||
if self.suppress_internals:
|
||||
test_class = self._suppressed_test_class()
|
||||
else:
|
||||
test_class = self._test_class()
|
||||
test_class = self._test_class()
|
||||
return test_class(self, path, self._path_to_name(path), self.test_config,
|
||||
**kwargs)
|
||||
|
||||
def _suppressed_test_class(self):
|
||||
"""Optional testcase that suppresses assertions. Used by fuzzers that are
|
||||
only interested in dchecks or tsan and that might violate the assertions
|
||||
through fuzzing.
|
||||
"""
|
||||
return self._test_class()
|
||||
|
||||
def _test_class(self):
|
||||
raise NotImplementedError
|
||||
|
||||
|
@ -72,11 +72,6 @@ class NumFuzzer(base_runner.BaseTestRunner):
|
||||
help="extends --stress-deopt to have minimum interval "
|
||||
"between deopt points")
|
||||
|
||||
# Stress interrupt budget
|
||||
parser.add_option("--stress-interrupt-budget", default=0, type="int",
|
||||
help="probability [0-10] of adding --interrupt-budget "
|
||||
"flag to the test")
|
||||
|
||||
# Combine multiple tests
|
||||
parser.add_option("--combine-tests", default=False, action="store_true",
|
||||
help="Combine multiple tests as one and run with "
|
||||
@ -115,14 +110,6 @@ class NumFuzzer(base_runner.BaseTestRunner):
|
||||
def _get_default_suite_names(self):
|
||||
return DEFAULT_SUITES
|
||||
|
||||
def _timeout_scalefactor(self, options):
|
||||
factor = super(NumFuzzer, self)._timeout_scalefactor(options)
|
||||
if options.stress_interrupt_budget:
|
||||
# TODO(machenbach): This should be moved to a more generic config.
|
||||
# Fuzzers have too much timeout in debug mode.
|
||||
factor = max(int(factor * 0.25), 1)
|
||||
return factor
|
||||
|
||||
def _get_statusfile_variables(self, options):
|
||||
variables = (
|
||||
super(NumFuzzer, self)._get_statusfile_variables(options))
|
||||
@ -190,10 +177,6 @@ class NumFuzzer(base_runner.BaseTestRunner):
|
||||
suites = super(NumFuzzer, self)._load_suites(names, options)
|
||||
if options.combine_tests:
|
||||
suites = [s for s in suites if s.test_combiner_available()]
|
||||
if options.stress_interrupt_budget:
|
||||
# Changing interrupt budget forces us to suppress certain test assertions.
|
||||
for suite in suites:
|
||||
suite.do_suppress_internals()
|
||||
return suites
|
||||
|
||||
def _create_combiner(self, rng, options):
|
||||
@ -217,7 +200,7 @@ class NumFuzzer(base_runner.BaseTestRunner):
|
||||
|
||||
def _disable_analysis(self, options):
|
||||
"""Disable analysis phase when options are used that don't support it."""
|
||||
return options.combine_tests or options.stress_interrupt_budget
|
||||
return options.combine_tests
|
||||
|
||||
def _create_fuzzer_configs(self, options):
|
||||
fuzzers = []
|
||||
@ -231,7 +214,6 @@ class NumFuzzer(base_runner.BaseTestRunner):
|
||||
add('gc_interval', options.stress_gc)
|
||||
add('threads', options.stress_thread_pool_size)
|
||||
add('delay', options.stress_delay_tasks)
|
||||
add('interrupt_budget', options.stress_interrupt_budget)
|
||||
add('deopt', options.stress_deopt, options.stress_deopt_min)
|
||||
return fuzzers
|
||||
|
||||
|
@ -229,13 +229,6 @@ class ThreadPoolSizeFuzzer(Fuzzer):
|
||||
yield ['--thread-pool-size=%d' % rng.randint(1, 8)]
|
||||
|
||||
|
||||
class InterruptBudgetFuzzer(Fuzzer):
|
||||
def create_flags_generator(self, rng, test, analysis_value):
|
||||
while True:
|
||||
limit = 1 + int(rng.random() * 144)
|
||||
yield ['--interrupt-budget=%d' % rng.randint(1, limit * 1024)]
|
||||
|
||||
|
||||
class DeoptAnalyzer(Analyzer):
|
||||
MAX_DEOPT=1000000000
|
||||
|
||||
@ -278,7 +271,6 @@ FUZZERS = {
|
||||
'delay': (None, TaskDelayFuzzer),
|
||||
'deopt': (DeoptAnalyzer, DeoptFuzzer),
|
||||
'gc_interval': (GcIntervalAnalyzer, GcIntervalFuzzer),
|
||||
'interrupt_budget': (None, InterruptBudgetFuzzer),
|
||||
'marking': (MarkingAnalyzer, MarkingFuzzer),
|
||||
'scavenge': (ScavengeAnalyzer, ScavengeFuzzer),
|
||||
'threads': (None, ThreadPoolSizeFuzzer),
|
||||
|
Loading…
Reference in New Issue
Block a user