Commit 27771088 authored by earthdok@chromium.org's avatar earthdok@chromium.org

Limit the layout_test batch size for *SAN builds.

Restarting content_shell periodically helps keep memory usage down. This should
improve cycle times on bots by preventing the machines from going into swap.

BUG=427569
R=dpranke@chromium.org

Review URL: https://codereview.chromium.org/709603005

git-svn-id: svn://svn.chromium.org/blink/trunk@185146 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 943633d0
......@@ -258,6 +258,16 @@ class Port(object):
self._pretty_patch_available = self.check_pretty_patch(logging=False)
return self._pretty_patch_available
def default_batch_size(self):
"""Return the default batch size to use for this port."""
if self.get_option('enable_sanitizer'):
# ASAN/MSAN/TSAN use more memory than regular content_shell. Their
# memory usage may also grow over time, up to a certain point.
# Relaunching the driver periodically helps keep it under control.
return 50
# The default is infinte batch size.
return None
def default_child_processes(self):
"""Return the number of drivers to use for this port."""
if self.get_option('enable_sanitizer'):
......
......@@ -129,9 +129,17 @@ class PortTestCase(unittest.TestCase):
test_run_results.UNEXPECTED_ERROR_EXIT_STATUS)
finally:
out, err, logs = oc.restore_output()
self.assertIn('pretty patches', logs) # And, hereere we should get warnings about both.
self.assertIn('pretty patches', logs) # And, here we should get warnings about both.
self.assertIn('build requirements', logs)
def test_default_batch_size(self):
port = self.make_port()
# Test that we set a finite batch size for sanitizer builds.
port._options.enable_sanitizer = True
sanitized_batch_size = port.default_batch_size()
self.assertIsNotNone(sanitized_batch_size)
def test_default_child_processes(self):
port = self.make_port()
num_workers = port.default_child_processes()
......
......@@ -300,6 +300,9 @@ def parse_args(args):
def _set_up_derived_options(port, options, args):
"""Sets the options values that depend on other options values."""
if options.batch_size is None:
options.batch_size = port.default_batch_size()
if not options.child_processes:
options.child_processes = os.environ.get("WEBKIT_TEST_CHILD_PROCESSES",
str(port.default_child_processes()))
......
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