Diff
Modified: trunk/Tools/ChangeLog (106441 => 106442)
--- trunk/Tools/ChangeLog 2012-02-01 09:13:17 UTC (rev 106441)
+++ trunk/Tools/ChangeLog 2012-02-01 09:15:18 UTC (rev 106442)
@@ -1,3 +1,30 @@
+2012-02-01 Ryosuke Niwa <rn...@webkit.org>
+
+ run-perf-tests should restart DRT for each test
+ https://bugs.webkit.org/show_bug.cgi?id=77506
+
+ Reviewed by Adam Barth.
+
+ Always restart DRT when running performance tests in order to minimize the dependency between tests.
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ (ChromiumDriver.stop):
+ * Scripts/webkitpy/performance_tests/perftestsrunner.py:
+ (PerfTestsRunner._run_tests_set):
+ (PerfTestsRunner._run_single_test):
+ * Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py:
+ (create_runner):
+ (test_run_passing_test):
+ (test_run_silent_test):
+ (test_run_failed_test):
+ (test_run_tonguey_test):
+ (test_run_timeout_test):
+ (test_run_crash_test):
+ (test_run_test_set_kills_drt_per_run):
+ (test_run_test_set_kills_drt_per_run.TestDriverWithStopCount):
+ (test_run_test_set_kills_drt_per_run.TestDriverWithStopCount.__init__):
+ (test_run_test_set_kills_drt_per_run.TestDriverWithStopCount.stop):
+
2012-01-31 Hans Wennborg <h...@chromium.org>
Speech Input: Report speech element rect relative to window rather than frame
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py (106441 => 106442)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py 2012-02-01 09:13:17 UTC (rev 106441)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py 2012-02-01 09:15:18 UTC (rev 106442)
@@ -603,7 +603,8 @@
if self._proc.stderr:
self._proc.stderr.close()
time_out_ms = self._port.get_option('time_out_ms')
- if time_out_ms:
+ if time_out_ms and not self._no_timeout:
+ # FIXME: Port object shouldn't be dependent on layout test manager.
kill_timeout_seconds = 3.0 * int(time_out_ms) / Manager.DEFAULT_TEST_TIMEOUT_MS
else:
kill_timeout_seconds = 3.0
Modified: trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py (106441 => 106442)
--- trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py 2012-02-01 09:13:17 UTC (rev 106441)
+++ trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py 2012-02-01 09:15:18 UTC (rev 106442)
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-# Copyright (C) 2011 Google Inc. All rights reserved.
+# Copyright (C) 2012 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -202,30 +202,21 @@
result_count = len(tests)
expected = 0
unexpected = 0
- driver_need_restart = False
- driver = None
for test in tests:
- if driver_need_restart:
- _log.error("%s killing driver" % test)
- driver.stop()
- driver = None
- if not driver:
- driver = port.create_driver(worker_number=1, no_timeout=True)
+ driver = port.create_driver(worker_number=1, no_timeout=True)
relative_test_path = self._host.filesystem.relpath(test, self._base_path)
self._printer.write('Running %s (%d of %d)' % (relative_test_path, expected + unexpected + 1, len(tests)))
is_chromium_style = self._host.filesystem.split(relative_test_path)[0] in self._test_directories_for_chromium_style_tests
- test_failed, driver_need_restart = self._run_single_test(test, driver, is_chromium_style)
- if test_failed:
- unexpected = unexpected + 1
- else:
+ if self._run_single_test(test, driver, is_chromium_style):
expected = expected + 1
+ else:
+ unexpected = unexpected + 1
self._printer.write('')
- if driver:
driver.stop()
return unexpected
@@ -290,7 +281,6 @@
def _run_single_test(self, test, driver, is_chromium_style):
test_failed = False
- driver_need_restart = False
output = driver.run_test(DriverInput(test, self._options.time_out_ms, None, False))
if output.text == None:
@@ -298,10 +288,8 @@
elif output.timeout:
self._printer.write('timeout: %s' % test[self._webkit_base_dir_len + 1:])
test_failed = True
- driver_need_restart = True
elif output.crash:
self._printer.write('crash: %s' % test[self._webkit_base_dir_len + 1:])
- driver_need_restart = True
test_failed = True
else:
if is_chromium_style:
@@ -316,4 +304,4 @@
if test_failed:
self._printer.write('FAILED')
- return test_failed, driver_need_restart
+ return not test_failed
Modified: trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py (106441 => 106442)
--- trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py 2012-02-01 09:13:17 UTC (rev 106441)
+++ trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py 2012-02-01 09:15:18 UTC (rev 106442)
@@ -1,5 +1,5 @@
#!/usr/bin/python
-# Copyright (C) 2011 Google Inc. All rights reserved.
+# Copyright (C) 2012 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -104,13 +104,13 @@
def stop(self):
"""do nothing"""
- def create_runner(self, buildbot_output=None, args=[], regular_output=None):
+ def create_runner(self, buildbot_output=None, args=[], regular_output=None, driver_class=TestDriver):
buildbot_output = buildbot_output or array_stream.ArrayStream()
regular_output = regular_output or array_stream.ArrayStream()
options, parsed_args = PerfTestsRunner._parse_args(args)
test_port = TestPort(host=MockHost(), options=options)
- test_port.create_driver = lambda worker_number=None, no_timeout=False: MainTest.TestDriver()
+ test_port.create_driver = lambda worker_number=None, no_timeout=False: driver_class()
runner = PerfTestsRunner(regular_output, buildbot_output, args=args, port=test_port)
runner._host.filesystem.maybe_make_directory(runner._base_path, 'inspector')
@@ -124,34 +124,22 @@
return runner._run_single_test(test_name, driver, is_chromium_style=True)
def test_run_passing_test(self):
- test_failed, driver_need_restart = self.run_test('pass.html')
- self.assertFalse(test_failed)
- self.assertFalse(driver_need_restart)
+ self.assertTrue(self.run_test('pass.html'))
def test_run_silent_test(self):
- test_failed, driver_need_restart = self.run_test('silent.html')
- self.assertTrue(test_failed)
- self.assertFalse(driver_need_restart)
+ self.assertFalse(self.run_test('silent.html'))
def test_run_failed_test(self):
- test_failed, driver_need_restart = self.run_test('failed.html')
- self.assertTrue(test_failed)
- self.assertFalse(driver_need_restart)
+ self.assertFalse(self.run_test('failed.html'))
def test_run_tonguey_test(self):
- test_failed, driver_need_restart = self.run_test('tonguey.html')
- self.assertTrue(test_failed)
- self.assertFalse(driver_need_restart)
+ self.assertFalse(self.run_test('tonguey.html'))
def test_run_timeout_test(self):
- test_failed, driver_need_restart = self.run_test('timeout.html')
- self.assertTrue(test_failed)
- self.assertTrue(driver_need_restart)
+ self.assertFalse(self.run_test('timeout.html'))
def test_run_crash_test(self):
- test_failed, driver_need_restart = self.run_test('crash.html')
- self.assertTrue(test_failed)
- self.assertTrue(driver_need_restart)
+ self.assertFalse(self.run_test('crash.html'))
def test_run_test_set(self):
buildbot_output = array_stream.ArrayStream()
@@ -164,6 +152,27 @@
self.assertEqual(len(buildbot_output.get()), 1)
self.assertEqual(buildbot_output.get()[0], 'RESULT group_name: test_name= 42 ms\n')
+ def test_run_test_set_kills_drt_per_run(self):
+
+ class TestDriverWithStopCount(MainTest.TestDriver):
+ stop_count = 0
+
+ def __init__(self):
+ TestDriverWithStopCount.sotp_count = 0
+
+ def stop(self):
+ TestDriverWithStopCount.stop_count += 1
+
+ buildbot_output = array_stream.ArrayStream()
+ runner = self.create_runner(buildbot_output, driver_class=TestDriverWithStopCount)
+
+ dirname = runner._base_path + '/inspector/'
+ tests = [dirname + 'pass.html', dirname + 'silent.html', dirname + 'failed.html',
+ dirname + 'tonguey.html', dirname + 'timeout.html', dirname + 'crash.html']
+
+ unexpected_result_count = runner._run_tests_set(tests, runner._port)
+ self.assertEqual(TestDriverWithStopCount.stop_count, 6)
+
def test_run_test_set_for_parser_tests(self):
buildbot_output = array_stream.ArrayStream()
runner = self.create_runner(buildbot_output)