Commit a3f983a4 authored by Michal Majewski's avatar Michal Majewski Committed by Commit Bot

Use new stress marking flag in gc fuzzer. Skip failed tests.

Bug: v8:6917
Change-Id: I41324b8bf1827c43a652fa5f6b83731eaa17776d
Reviewed-on: https://chromium-review.googlesource.com/766887Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Commit-Queue: Michał Majewski <majeski@google.com>
Cr-Commit-Position: refs/heads/master@{#49341}
parent 8b54fec8
...@@ -148,6 +148,9 @@ class DeoptFuzzer(base_runner.BaseTestRunner): ...@@ -148,6 +148,9 @@ class DeoptFuzzer(base_runner.BaseTestRunner):
default= -1, type="int") default= -1, type="int")
parser.add_option("--random-seed", default=0, dest="random_seed", parser.add_option("--random-seed", default=0, dest="random_seed",
help="Default seed for initializing random generator") help="Default seed for initializing random generator")
parser.add_option("--fuzzer-random-seed", default=0,
help="Default seed for initializing fuzzer random "
"generator")
return parser return parser
......
...@@ -284,7 +284,7 @@ class GCFuzzer(base_runner.BaseTestRunner): ...@@ -284,7 +284,7 @@ class GCFuzzer(base_runner.BaseTestRunner):
analysis_flags = [ analysis_flags = [
# > 100% to not influence default incremental marking, but we need this # > 100% to not influence default incremental marking, but we need this
# flag to print reached incremental marking limit. # flag to print reached incremental marking limit.
'--stress_incremental_marking_percentage', '200', '--stress_marking', '1000',
'--trace_incremental_marking', '--trace_incremental_marking',
] ]
s.tests = map(lambda t: t.CopyAddingFlags(t.variant, analysis_flags), s.tests = map(lambda t: t.CopyAddingFlags(t.variant, analysis_flags),
...@@ -298,6 +298,10 @@ class GCFuzzer(base_runner.BaseTestRunner): ...@@ -298,6 +298,10 @@ class GCFuzzer(base_runner.BaseTestRunner):
test_results = dict() test_results = dict()
for s in suites: for s in suites:
for t in s.tests: for t in s.tests:
# Skip failed tests.
if s.HasUnexpectedOutput(t):
print '%s failed, skipping' % t.path
continue
max_limit = self._get_max_limit_reached(t) max_limit = self._get_max_limit_reached(t)
if max_limit: if max_limit:
test_results[t.path] = max_limit test_results[t.path] = max_limit
...@@ -317,26 +321,27 @@ class GCFuzzer(base_runner.BaseTestRunner): ...@@ -317,26 +321,27 @@ class GCFuzzer(base_runner.BaseTestRunner):
max_percent = int(max_percent) max_percent = int(max_percent)
# Calculate distribution. # Calculate distribution.
im_count = self._calculate_n_tests(max_percent, options) marking_count = self._calculate_n_tests(max_percent, options)
im_distribution = dist.Distribute(im_count, max_percent) marking_distribution = dist.Distribute(marking_count, max_percent)
if options.stress_compaction: if options.stress_compaction:
compaction_count = self._calculate_n_tests(100, options) compaction_count = self._calculate_n_tests(100, options)
compaction_distribution = dist.Distribute(compaction_count, 100) compaction_distribution = dist.Distribute(compaction_count, 100)
distribution = itertools.product( distribution = itertools.product(
im_distribution, compaction_distribution) marking_distribution, compaction_distribution)
else: else:
# 0 disables the second flag. # 0 disables the second flag.
distribution = itertools.product(im_distribution, [0]) distribution = itertools.product(marking_distribution, [0])
if options.verbose: if options.verbose:
distribution = list(distribution) distribution = list(distribution)
print "%s %s (max=%.02f)" % (t.path, distribution, max_percent) print ("%s %s (max marking limit=%.02f)" %
for im, compaction in distribution: (t.path, distribution, test_results[t.path]))
for marking, compaction in distribution:
fuzzing_flags = [ fuzzing_flags = [
"--stress_incremental_marking_percentage", str(im), "--stress_marking", str(marking),
"--stress_compaction_percentage", str(compaction), "--stress_compaction_percentage", str(compaction),
] ]
if options.random_seed: if options.fuzzer_random_seed:
fuzzing_flags += [ fuzzing_flags += [
'--fuzzer_random_seed', str(options.fuzzer_random_seed) '--fuzzer_random_seed', str(options.fuzzer_random_seed)
] ]
...@@ -396,7 +401,7 @@ class GCFuzzer(base_runner.BaseTestRunner): ...@@ -396,7 +401,7 @@ class GCFuzzer(base_runner.BaseTestRunner):
# Parses test stdout and returns what was the highest reached percent of the # Parses test stdout and returns what was the highest reached percent of the
# incremental marking limit (0-100). # incremental marking limit (0-100).
# Skips values above 100% since they already trigger incremental marking. # Skips values >=100% since they already trigger incremental marking.
@staticmethod @staticmethod
def _get_max_limit_reached(test): def _get_max_limit_reached(test):
def is_im_line(l): def is_im_line(l):
......
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