Diff
Modified: trunk/Tools/ChangeLog (124808 => 124809)
--- trunk/Tools/ChangeLog 2012-08-06 23:05:15 UTC (rev 124808)
+++ trunk/Tools/ChangeLog 2012-08-06 23:19:57 UTC (rev 124809)
@@ -1,3 +1,33 @@
+2012-08-06 Xianzhu Wang <[email protected]>
+
+ Remove NRWT --shard-ref-tests
+ https://bugs.webkit.org/show_bug.cgi?id=91539
+
+ This is basically a revert of "[Chromium-Android] Run ref tests together to avoid expensive driver restarts"
+ (https://bugs.webkit.org/show_bug.cgi?id=91533, http://trac.webkit.org/changeset/122914),
+ with some conflicts resolved (because of refactory of Manager/LayoutTestRunner/Sharder classes).
+
+ Reviewed by Dirk Pranke.
+
+ * Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py:
+ (LayoutTestRunner.run_tests):
+ (Sharder.shard_tests):
+ (Sharder._shard_in_two):
+ (Sharder._shard_by_directory):
+ * Scripts/webkitpy/layout_tests/controllers/layout_test_runner_unittest.py:
+ (SharderTests):
+ (SharderTests.get_test_input):
+ (SharderTests.get_shards):
+ (SharderTests.test_shard_by_dir):
+ (SharderTests.test_shard_in_two):
+ * Scripts/webkitpy/layout_tests/controllers/manager.py:
+ (Manager._test_input_for_file):
+ (Manager._test_is_slow):
+ * Scripts/webkitpy/layout_tests/port/chromium_android.py:
+ (ChromiumAndroidPort.__init__):
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ (parse_args):
+
2012-08-06 Luciano Wolf <[email protected]>
[Qt] Default sizes for input-text and text-area are different when running DRT/WTR
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py (124808 => 124809)
--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py 2012-08-06 23:05:15 UTC (rev 124808)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py 2012-08-06 23:19:57 UTC (rev 124809)
@@ -112,7 +112,7 @@
interrupted = False
self._printer.write_update('Sharding tests ...')
- locked_shards, unlocked_shards = self._sharder.shard_tests(test_inputs, int(self._options.child_processes), self._options.fully_parallel, self._options.shard_ref_tests)
+ locked_shards, unlocked_shards = self._sharder.shard_tests(test_inputs, int(self._options.child_processes), self._options.fully_parallel)
# FIXME: We don't have a good way to coordinate the workers so that
# they don't try to run the shards that need a lock if we don't actually
@@ -475,7 +475,7 @@
self._sep = test_path_separator
self._max_locked_shards = max_locked_shards
- def shard_tests(self, test_inputs, num_workers, fully_parallel, shard_ref_tests):
+ def shard_tests(self, test_inputs, num_workers, fully_parallel):
"""Groups tests into batches.
This helps ensure that tests that depend on each other (aka bad tests!)
continue to run together as most cross-tests dependencies tend to
@@ -489,39 +489,29 @@
# own class or module. Consider grouping it with the chunking logic
# in prepare_lists as well.
if num_workers == 1:
- return self._shard_in_two(test_inputs, shard_ref_tests)
+ return self._shard_in_two(test_inputs)
elif fully_parallel:
return self._shard_every_file(test_inputs)
- return self._shard_by_directory(test_inputs, num_workers, shard_ref_tests)
+ return self._shard_by_directory(test_inputs, num_workers)
- def _shard_in_two(self, test_inputs, shard_ref_tests):
+ def _shard_in_two(self, test_inputs):
"""Returns two lists of shards, one with all the tests requiring a lock and one with the rest.
This is used when there's only one worker, to minimize the per-shard overhead."""
locked_inputs = []
- locked_ref_test_inputs = []
unlocked_inputs = []
- unlocked_ref_test_inputs = []
for test_input in test_inputs:
if test_input.requires_lock:
- if shard_ref_tests and test_input.reference_files:
- locked_ref_test_inputs.append(test_input)
- else:
- locked_inputs.append(test_input)
+ locked_inputs.append(test_input)
else:
- if shard_ref_tests and test_input.reference_files:
- unlocked_ref_test_inputs.append(test_input)
- else:
- unlocked_inputs.append(test_input)
- locked_inputs.extend(locked_ref_test_inputs)
- unlocked_inputs.extend(unlocked_ref_test_inputs)
+ unlocked_inputs.append(test_input)
locked_shards = []
unlocked_shards = []
if locked_inputs:
locked_shards = [TestShard('locked_tests', locked_inputs)]
if unlocked_inputs:
- unlocked_shards.append(TestShard('unlocked_tests', unlocked_inputs))
+ unlocked_shards = [TestShard('unlocked_tests', unlocked_inputs)]
return locked_shards, unlocked_shards
@@ -542,7 +532,7 @@
return locked_shards, unlocked_shards
- def _shard_by_directory(self, test_inputs, num_workers, shard_ref_tests):
+ def _shard_by_directory(self, test_inputs, num_workers):
"""Returns two lists of shards, each shard containing all the files in a directory.
This is the default mode, and gets as much parallelism as we can while
@@ -550,17 +540,12 @@
locked_shards = []
unlocked_shards = []
tests_by_dir = {}
- ref_tests_by_dir = {}
# FIXME: Given that the tests are already sorted by directory,
# we can probably rewrite this to be clearer and faster.
for test_input in test_inputs:
directory = self._split(test_input.test_name)[0]
- if shard_ref_tests and test_input.reference_files:
- ref_tests_by_dir.setdefault(directory, [])
- ref_tests_by_dir[directory].append(test_input)
- else:
- tests_by_dir.setdefault(directory, [])
- tests_by_dir[directory].append(test_input)
+ tests_by_dir.setdefault(directory, [])
+ tests_by_dir[directory].append(test_input)
for directory, test_inputs in tests_by_dir.iteritems():
shard = TestShard(directory, test_inputs)
@@ -569,14 +554,6 @@
else:
unlocked_shards.append(shard)
- for directory, test_inputs in ref_tests_by_dir.iteritems():
- # '~' to place the ref tests after other tests after sorted.
- shard = TestShard('~ref:' + directory, test_inputs)
- if test_inputs[0].requires_lock:
- locked_shards.append(shard)
- else:
- unlocked_shards.append(shard)
-
# Sort the shards by directory name.
locked_shards.sort(key=lambda shard: shard.name)
unlocked_shards.sort(key=lambda shard: shard.name)
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner_unittest.py (124808 => 124809)
--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner_unittest.py 2012-08-06 23:05:15 UTC (rev 124808)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner_unittest.py 2012-08-06 23:19:57 UTC (rev 124809)
@@ -218,18 +218,10 @@
"perf/object-keys.html",
]
- ref_tests = [
- "http/tests/security/view-source-no-refresh.html",
- "http/tests/websocket/tests/websocket-protocol-ignored.html",
- "ietestcenter/_javascript_/11.1.5_4-4-c-1.html",
- "dom/html/level2/html/HTMLAnchorElement06.html",
- ]
-
def get_test_input(self, test_file):
- return TestInput(test_file, requires_lock=(test_file.startswith('http') or test_file.startswith('perf')),
- reference_files=(['foo'] if test_file in self.ref_tests else None))
+ return TestInput(test_file, requires_lock=(test_file.startswith('http') or test_file.startswith('perf')))
- def get_shards(self, num_workers, fully_parallel, shard_ref_tests=False, test_list=None, max_locked_shards=1):
+ def get_shards(self, num_workers, fully_parallel, test_list=None, max_locked_shards=1):
def split(test_name):
idx = test_name.rfind('/')
if idx != -1:
@@ -237,7 +229,7 @@
self.sharder = Sharder(split, '/', max_locked_shards)
test_list = test_list or self.test_list
- return self.sharder.shard_tests([self.get_test_input(test) for test in test_list], num_workers, fully_parallel, shard_ref_tests)
+ return self.sharder.shard_tests([self.get_test_input(test) for test in test_list], num_workers, fully_parallel)
def assert_shards(self, actual_shards, expected_shard_names):
self.assertEquals(len(actual_shards), len(expected_shard_names))
@@ -267,26 +259,6 @@
('fast/css', ['fast/css/display-none-inline-style-change-crash.html']),
('ietestcenter/_javascript_', ['ietestcenter/_javascript_/11.1.5_4-4-c-1.html'])])
- def test_shard_by_dir_sharding_ref_tests(self):
- locked, unlocked = self.get_shards(num_workers=2, fully_parallel=False, shard_ref_tests=True)
-
- # Note that although there are tests in multiple dirs that need locks,
- # they are crammed into a single shard in order to reduce the # of
- # workers hitting the server at once.
- self.assert_shards(locked,
- [('locked_shard_1',
- ['http/tests/websocket/tests/unicode.htm',
- 'http/tests/xmlhttprequest/supported-xml-content-types.html',
- 'perf/object-keys.html',
- 'http/tests/security/view-source-no-refresh.html',
- 'http/tests/websocket/tests/websocket-protocol-ignored.html'])])
- self.assert_shards(unlocked,
- [('animations', ['animations/keyframes.html']),
- ('dom/html/level2/html', ['dom/html/level2/html/HTMLAnchorElement03.html']),
- ('fast/css', ['fast/css/display-none-inline-style-change-crash.html']),
- ('~ref:dom/html/level2/html', ['dom/html/level2/html/HTMLAnchorElement06.html']),
- ('~ref:ietestcenter/_javascript_', ['ietestcenter/_javascript_/11.1.5_4-4-c-1.html'])])
-
def test_shard_every_file(self):
locked, unlocked = self.get_shards(num_workers=2, fully_parallel=True)
self.assert_shards(locked,
@@ -319,23 +291,6 @@
'ietestcenter/_javascript_/11.1.5_4-4-c-1.html',
'dom/html/level2/html/HTMLAnchorElement06.html'])])
- def test_shard_in_two_sharding_ref_tests(self):
- locked, unlocked = self.get_shards(num_workers=1, fully_parallel=False, shard_ref_tests=True)
- self.assert_shards(locked,
- [('locked_tests',
- ['http/tests/websocket/tests/unicode.htm',
- 'http/tests/xmlhttprequest/supported-xml-content-types.html',
- 'perf/object-keys.html',
- 'http/tests/security/view-source-no-refresh.html',
- 'http/tests/websocket/tests/websocket-protocol-ignored.html'])])
- self.assert_shards(unlocked,
- [('unlocked_tests',
- ['animations/keyframes.html',
- 'fast/css/display-none-inline-style-change-crash.html',
- 'dom/html/level2/html/HTMLAnchorElement03.html',
- 'ietestcenter/_javascript_/11.1.5_4-4-c-1.html',
- 'dom/html/level2/html/HTMLAnchorElement06.html'])])
-
def test_shard_in_two_has_no_locked_shards(self):
locked, unlocked = self.get_shards(num_workers=1, fully_parallel=False,
test_list=['animations/keyframe.html'])
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py (124808 => 124809)
--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py 2012-08-06 23:05:15 UTC (rev 124808)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py 2012-08-06 23:19:57 UTC (rev 124809)
@@ -336,8 +336,7 @@
def _test_input_for_file(self, test_file):
return TestInput(test_file,
self._options.slow_time_out_ms if self._test_is_slow(test_file) else self._options.time_out_ms,
- self._test_requires_lock(test_file),
- self._port.reference_files(test_file) if self._options.shard_ref_tests else None)
+ self._test_requires_lock(test_file))
def _test_requires_lock(self, test_file):
"""Return True if the test needs to be locked when
@@ -349,12 +348,6 @@
def _test_is_slow(self, test_file):
return self._expectations.has_modifier(test_file, test_expectations.SLOW)
- def _is_ref_test(self, test_input):
- if test_input.reference_files is None:
- # Lazy initialization.
- test_input.reference_files = self._port.reference_files(test_input.test_name)
- return bool(test_input.reference_files)
-
def needs_servers(self):
return any(self._test_requires_lock(test_name) for test_name in self._test_names) and self._options.http
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py (124808 => 124809)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py 2012-08-06 23:05:15 UTC (rev 124808)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py 2012-08-06 23:19:57 UTC (rev 124809)
@@ -161,9 +161,6 @@
# The Chromium port for Android always uses the hardware GPU path.
self._options.additional_drt_flag.append('--enable-hardware-gpu')
- # Shard ref tests so that they run together to avoid repeatedly driver restarts.
- self._options.shard_ref_tests = True
-
self._operating_system = 'android'
self._version = 'icecreamsandwich'
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py (124808 => 124809)
--- trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py 2012-08-06 23:05:15 UTC (rev 124808)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py 2012-08-06 23:19:57 UTC (rev 124809)
@@ -413,11 +413,6 @@
help="Don't re-try any tests that produce unexpected results."),
optparse.make_option("--max-locked-shards", type="int", default=1,
help="Set the maximum number of locked shards"),
- # For chromium-android to reduce the cost of restarting the driver.
- # FIXME: Remove the option once per-test arg is supported:
- # https://bugs.webkit.org/show_bug.cgi?id=91539.
- optparse.make_option("--shard-ref-tests", action=""
- help="Run ref tests in dedicated shard(s). Enabled on Android by default."),
optparse.make_option("--additional-env-var", type="string", action="" default=[],
help="Passes that environment variable to the tests (--additional-env-var=NAME=VALUE)"),
]))