Commit 1efb130a authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

[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/1404437Reviewed-by: 's avatarSergiy Belozorov <sergiyb@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58735}
parent c7410e8c
// 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): ...@@ -81,9 +81,6 @@ class TestSuite(testsuite.TestSuite):
def _test_class(self): def _test_class(self):
return TestCase return TestCase
def _suppressed_test_class(self):
return SuppressedTestCase
class TestCase(testcase.D8TestCase): class TestCase(testcase.D8TestCase):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
...@@ -282,27 +279,5 @@ class CombinedTest(testcase.D8TestCase): ...@@ -282,27 +279,5 @@ class CombinedTest(testcase.D8TestCase):
test._get_statusfile_flags() for test in self._tests) 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): def GetSuite(*args, **kwargs):
return TestSuite(*args, **kwargs) return TestSuite(*args, **kwargs)
...@@ -97,19 +97,10 @@ class TestSuite(object): ...@@ -97,19 +97,10 @@ class TestSuite(object):
self.test_config = test_config self.test_config = test_config
self.tests = None # list of TestCase objects self.tests = None # list of TestCase objects
self.statusfile = None self.statusfile = None
self.suppress_internals = False
def status_file(self): def status_file(self):
return "%s/%s.status" % (self.root, self.name) 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): def ListTests(self):
raise NotImplementedError raise NotImplementedError
...@@ -141,20 +132,10 @@ class TestSuite(object): ...@@ -141,20 +132,10 @@ class TestSuite(object):
self.tests = self.ListTests() self.tests = self.ListTests()
def _create_test(self, path, **kwargs): def _create_test(self, path, **kwargs):
if self.suppress_internals: test_class = self._test_class()
test_class = self._suppressed_test_class()
else:
test_class = self._test_class()
return test_class(self, path, self._path_to_name(path), self.test_config, return test_class(self, path, self._path_to_name(path), self.test_config,
**kwargs) **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): def _test_class(self):
raise NotImplementedError raise NotImplementedError
......
...@@ -72,11 +72,6 @@ class NumFuzzer(base_runner.BaseTestRunner): ...@@ -72,11 +72,6 @@ class NumFuzzer(base_runner.BaseTestRunner):
help="extends --stress-deopt to have minimum interval " help="extends --stress-deopt to have minimum interval "
"between deopt points") "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 # Combine multiple tests
parser.add_option("--combine-tests", default=False, action="store_true", parser.add_option("--combine-tests", default=False, action="store_true",
help="Combine multiple tests as one and run with " help="Combine multiple tests as one and run with "
...@@ -115,14 +110,6 @@ class NumFuzzer(base_runner.BaseTestRunner): ...@@ -115,14 +110,6 @@ class NumFuzzer(base_runner.BaseTestRunner):
def _get_default_suite_names(self): def _get_default_suite_names(self):
return DEFAULT_SUITES 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): def _get_statusfile_variables(self, options):
variables = ( variables = (
super(NumFuzzer, self)._get_statusfile_variables(options)) super(NumFuzzer, self)._get_statusfile_variables(options))
...@@ -190,10 +177,6 @@ class NumFuzzer(base_runner.BaseTestRunner): ...@@ -190,10 +177,6 @@ class NumFuzzer(base_runner.BaseTestRunner):
suites = super(NumFuzzer, self)._load_suites(names, options) suites = super(NumFuzzer, self)._load_suites(names, options)
if options.combine_tests: if options.combine_tests:
suites = [s for s in suites if s.test_combiner_available()] 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 return suites
def _create_combiner(self, rng, options): def _create_combiner(self, rng, options):
...@@ -217,7 +200,7 @@ class NumFuzzer(base_runner.BaseTestRunner): ...@@ -217,7 +200,7 @@ class NumFuzzer(base_runner.BaseTestRunner):
def _disable_analysis(self, options): def _disable_analysis(self, options):
"""Disable analysis phase when options are used that don't support it.""" """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): def _create_fuzzer_configs(self, options):
fuzzers = [] fuzzers = []
...@@ -231,7 +214,6 @@ class NumFuzzer(base_runner.BaseTestRunner): ...@@ -231,7 +214,6 @@ class NumFuzzer(base_runner.BaseTestRunner):
add('gc_interval', options.stress_gc) add('gc_interval', options.stress_gc)
add('threads', options.stress_thread_pool_size) add('threads', options.stress_thread_pool_size)
add('delay', options.stress_delay_tasks) add('delay', options.stress_delay_tasks)
add('interrupt_budget', options.stress_interrupt_budget)
add('deopt', options.stress_deopt, options.stress_deopt_min) add('deopt', options.stress_deopt, options.stress_deopt_min)
return fuzzers return fuzzers
......
...@@ -229,13 +229,6 @@ class ThreadPoolSizeFuzzer(Fuzzer): ...@@ -229,13 +229,6 @@ class ThreadPoolSizeFuzzer(Fuzzer):
yield ['--thread-pool-size=%d' % rng.randint(1, 8)] 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): class DeoptAnalyzer(Analyzer):
MAX_DEOPT=1000000000 MAX_DEOPT=1000000000
...@@ -278,7 +271,6 @@ FUZZERS = { ...@@ -278,7 +271,6 @@ FUZZERS = {
'delay': (None, TaskDelayFuzzer), 'delay': (None, TaskDelayFuzzer),
'deopt': (DeoptAnalyzer, DeoptFuzzer), 'deopt': (DeoptAnalyzer, DeoptFuzzer),
'gc_interval': (GcIntervalAnalyzer, GcIntervalFuzzer), 'gc_interval': (GcIntervalAnalyzer, GcIntervalFuzzer),
'interrupt_budget': (None, InterruptBudgetFuzzer),
'marking': (MarkingAnalyzer, MarkingFuzzer), 'marking': (MarkingAnalyzer, MarkingFuzzer),
'scavenge': (ScavengeAnalyzer, ScavengeFuzzer), 'scavenge': (ScavengeAnalyzer, ScavengeFuzzer),
'threads': (None, ThreadPoolSizeFuzzer), 'threads': (None, ThreadPoolSizeFuzzer),
......
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