Navigation Menu

Skip to content

Commit

Permalink
Some perf tests time out when ran by run-perf-tests
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=76612

Reviewed by Dirk Pranke and Eric Seidel.

PerformanceTests: 

Replace all images in html5.html by geenbox.png to avoid accessing whatwg.org when
running the parser tests. Also call dumpAsText, waitUntilDone, and notifyDone automatically
inside runner.js to avoid having to call them in individual tests.

* Bindings/event-target-wrapper.html: Removed calls to layoutTestController methods since
they are now called by runner.js automatically.
* Parser/resources/greenbox.png: Copied from LayoutTests/fast/css/resources/greenbox.png.
* Parser/resources/html5.html:
* Parser/resources/runner.js:
(runLoop):

Tools: 

Always pass --no-timeout to DumpRenderTree from run-perf-tests.
Otherwise some tests such as Parser/xml-parser.html will timeout.

--no-timeout option is currently supported by Chromium and Mac ports.

* Scripts/webkitpy/layout_tests/port/base.py:
(Port.to.create_driver):
* Scripts/webkitpy/layout_tests/port/chromium.py:
(ChromiumDriver.__init__):
(ChromiumDriver._wrapper_options):
* Scripts/webkitpy/layout_tests/port/driver.py:
(Driver.__init__):
(DriverProxy.__init__):
* Scripts/webkitpy/layout_tests/port/webkit.py:
(WebKitDriver.__init__):
(WebKitDriver.cmd_line):
* Scripts/webkitpy/layout_tests/port/webkit_unittest.py:
(WebKitDriverTest.test_read_binary_block):
(WebKitDriverTest):
(WebKitDriverTest.test_no_timeout):
* Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
(get_tests_run.RecordingTestDriver.__init__):
* Scripts/webkitpy/performance_tests/perftestsrunner.py:
(PerfTestsRunner._parse_args):
(PerfTestsRunner._run_tests_set):
* Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py:
(create_runner):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105443 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
rniwa@webkit.org committed Jan 19, 2012
1 parent 5d0b30a commit 780e1d3
Show file tree
Hide file tree
Showing 14 changed files with 111 additions and 49 deletions.
10 changes: 1 addition & 9 deletions PerformanceTests/Bindings/event-target-wrapper.html
Expand Up @@ -18,19 +18,11 @@
for (var x = 0; x < kIteratonsPerTest; x++) {
e.target;
}
}, 10, function() {
if (window.layoutTestController)
layoutTestController.notifyDone();
});
}, 10);

return false;
}, false);

if (window.layoutTestController) {
layoutTestController.waitUntilDone();
layoutTestController.dumpAsText();
}

if (window.eventSender) {
eventSender.mouseMoveTo(link.offsetLeft + 5, link.offsetTop + 5);
eventSender.mouseDown();
Expand Down
18 changes: 18 additions & 0 deletions PerformanceTests/ChangeLog
@@ -1,3 +1,21 @@
2012-01-19 Ryosuke Niwa <rniwa@webkit.org>

Some perf tests time out when ran by run-perf-tests
https://bugs.webkit.org/show_bug.cgi?id=76612

Reviewed by Dirk Pranke and Eric Seidel.

Replace all images in html5.html by geenbox.png to avoid accessing whatwg.org when
running the parser tests. Also call dumpAsText, waitUntilDone, and notifyDone automatically
inside runner.js to avoid having to call them in individual tests.

* Bindings/event-target-wrapper.html: Removed calls to layoutTestController methods since
they are now called by runner.js automatically.
* Parser/resources/greenbox.png: Copied from LayoutTests/fast/css/resources/greenbox.png.
* Parser/resources/html5.html:
* Parser/resources/runner.js:
(runLoop):

2012-01-18 Ryosuke Niwa <rniwa@webkit.org>

run-perf-tests should support Skipped list
Expand Down
Binary file added PerformanceTests/Parser/resources/greenbox.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 26 additions & 26 deletions PerformanceTests/Parser/resources/html5.html

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions PerformanceTests/Parser/resources/runner.js
Expand Up @@ -74,6 +74,8 @@ function runLoop()
} else {
logStatistics(times);
window.doneFunction();
if (window.layoutTestController)
layoutTestController.notifyDone();
}
}

Expand Down Expand Up @@ -101,3 +103,8 @@ function start(runCount, runFunction, loopsPerRun, doneFunction) {
log("Running " + runCount + " times");
runLoop();
}

if (window.layoutTestController) {
layoutTestController.waitUntilDone();
layoutTestController.dumpAsText();
}
35 changes: 35 additions & 0 deletions Tools/ChangeLog
@@ -1,3 +1,38 @@
2012-01-19 Ryosuke Niwa <rniwa@webkit.org>

Some perf tests time out when ran by run-perf-tests
https://bugs.webkit.org/show_bug.cgi?id=76612

Reviewed by Dirk Pranke and Eric Seidel.

Always pass --no-timeout to DumpRenderTree from run-perf-tests.
Otherwise some tests such as Parser/xml-parser.html will timeout.

--no-timeout option is currently supported by Chromium and Mac ports.

* Scripts/webkitpy/layout_tests/port/base.py:
(Port.to.create_driver):
* Scripts/webkitpy/layout_tests/port/chromium.py:
(ChromiumDriver.__init__):
(ChromiumDriver._wrapper_options):
* Scripts/webkitpy/layout_tests/port/driver.py:
(Driver.__init__):
(DriverProxy.__init__):
* Scripts/webkitpy/layout_tests/port/webkit.py:
(WebKitDriver.__init__):
(WebKitDriver.cmd_line):
* Scripts/webkitpy/layout_tests/port/webkit_unittest.py:
(WebKitDriverTest.test_read_binary_block):
(WebKitDriverTest):
(WebKitDriverTest.test_no_timeout):
* Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
(get_tests_run.RecordingTestDriver.__init__):
* Scripts/webkitpy/performance_tests/perftestsrunner.py:
(PerfTestsRunner._parse_args):
(PerfTestsRunner._run_tests_set):
* Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py:
(create_runner):

2012-01-19 Ben Wells <benwells@chromium.org>

Add support for window.print to chromium DRT
Expand Down
4 changes: 2 additions & 2 deletions Tools/Scripts/webkitpy/layout_tests/port/base.py
Expand Up @@ -740,9 +740,9 @@ def show_results_html_file(self, results_filename):
results_filename in a users' browser."""
return self.host.user.open_url(path.abspath_to_uri(results_filename))

def create_driver(self, worker_number):
def create_driver(self, worker_number, no_timeout=False):
"""Return a newly created Driver subclass for starting/stopping the test driver."""
return driver.DriverProxy(self, worker_number, self._driver_class(), pixel_tests=self.get_option('pixel_tests'))
return driver.DriverProxy(self, worker_number, self._driver_class(), pixel_tests=self.get_option('pixel_tests'), no_timeout=no_timeout)

def start_helper(self):
"""If a port needs to reconfigure graphics settings or do other
Expand Down
6 changes: 4 additions & 2 deletions Tools/Scripts/webkitpy/layout_tests/port/chromium.py
Expand Up @@ -391,8 +391,8 @@ def _path_to_image_diff(self):

# FIXME: This should inherit from WebKitDriver now that Chromium has a DumpRenderTree process like the rest of WebKit.
class ChromiumDriver(Driver):
def __init__(self, port, worker_number, pixel_tests):
Driver.__init__(self, port, worker_number, pixel_tests)
def __init__(self, port, worker_number, pixel_tests, no_timeout=False):
Driver.__init__(self, port, worker_number, pixel_tests, no_timeout)
self._proc = None
self._image_path = None
if self._pixel_tests:
Expand All @@ -406,6 +406,8 @@ def _wrapper_options(self):
# FIXME: This is not None shouldn't be necessary, unless --js-flags="''" changes behavior somehow?
if self._port.get_option('js_flags') is not None:
cmd.append('--js-flags="' + self._port.get_option('js_flags') + '"')
if self._no_timeout:
cmd.append("--no-timeout")

# FIXME: We should be able to build this list using only an array of
# option names, the options (optparse.Values) object, and the orignal
Expand Down
9 changes: 5 additions & 4 deletions Tools/Scripts/webkitpy/layout_tests/port/driver.py
Expand Up @@ -63,7 +63,7 @@ def has_stderr(self):
class Driver(object):
"""Abstract interface for the DumpRenderTree interface."""

def __init__(self, port, worker_number, pixel_tests):
def __init__(self, port, worker_number, pixel_tests, no_timeout=False):
"""Initialize a Driver to subsequently run tests.
Typically this routine will spawn DumpRenderTree in a config
Expand All @@ -75,6 +75,7 @@ def __init__(self, port, worker_number, pixel_tests):
self._port = port
self._worker_number = worker_number
self._pixel_tests = pixel_tests
self._no_timeout = no_timeout

def run_test(self, driver_input):
"""Run a single test and return the results.
Expand Down Expand Up @@ -142,12 +143,12 @@ class DriverProxy(object):
one without. This allows us to handle plain text tests and ref tests with a
single driver."""

def __init__(self, port, worker_number, driver_instance_constructor, pixel_tests):
self._driver = driver_instance_constructor(port, worker_number, pixel_tests)
def __init__(self, port, worker_number, driver_instance_constructor, pixel_tests, no_timeout):
self._driver = driver_instance_constructor(port, worker_number, pixel_tests, no_timeout)
if pixel_tests:
self._reftest_driver = self._driver
else:
self._reftest_driver = driver_instance_constructor(port, worker_number, pixel_tests=True)
self._reftest_driver = driver_instance_constructor(port, worker_number, pixel_tests, no_timeout)

def is_http_test(self, test_name):
return self._driver.is_http_test(test_name)
Expand Down
6 changes: 4 additions & 2 deletions Tools/Scripts/webkitpy/layout_tests/port/webkit.py
Expand Up @@ -448,8 +448,8 @@ def _path_to_apache_config_file(self):
class WebKitDriver(Driver):
"""WebKit implementation of the DumpRenderTree/WebKitTestRunner interface."""

def __init__(self, port, worker_number, pixel_tests):
Driver.__init__(self, port, worker_number, pixel_tests)
def __init__(self, port, worker_number, pixel_tests, no_timeout=False):
Driver.__init__(self, port, worker_number, pixel_tests, no_timeout)
self._driver_tempdir = port._filesystem.mkdtemp(prefix='%s-' % self._port.driver_name())
# WebKitTestRunner can report back subprocess crashes by printing
# "#CRASHED - PROCESSNAME". Since those can happen at any time
Expand Down Expand Up @@ -481,6 +481,8 @@ def cmd_line(self):
cmd.append('--complex-text')
if self._port.get_option('threaded'):
cmd.append('--threaded')
if self._no_timeout:
cmd.append('--no-timeout')
# FIXME: We need to pass --timeout=SECONDS to WebKitTestRunner for WebKit2.

cmd.extend(self._port.get_option('additional_drt_flag', []))
Expand Down
5 changes: 5 additions & 0 deletions Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py
Expand Up @@ -284,3 +284,8 @@ def test_read_binary_block(self):
self.assertEquals(content_block.content_hash, 'actual')
self.assertEquals(content_block.content, '12345678')
self.assertEquals(content_block.decoded_content, '12345678')

def test_no_timeout(self):
port = TestWebKitPort()
driver = WebKitDriver(port, 0, pixel_tests=True, no_timeout=True)
self.assertEquals(driver.cmd_line(), ['MOCK output of child process/DumpRenderTree', '--pixel-tests', '--no-timeout', '-'])
Expand Up @@ -150,7 +150,7 @@ def get_tests_run(extra_args=None, tests_included=False, flatten_batches=False,

class RecordingTestDriver(TestDriver):
def __init__(self, port, worker_number):
TestDriver.__init__(self, port, worker_number, pixel_tests=port.get_option('pixel_test'))
TestDriver.__init__(self, port, worker_number, pixel_tests=port.get_option('pixel_test'), no_timeout=False)
self._current_test_batch = None

def stop(self):
Expand Down
4 changes: 2 additions & 2 deletions Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py
Expand Up @@ -79,7 +79,7 @@ def _parse_args(args=None):
help="Check to ensure the DumpRenderTree build is up-to-date (default)."),
optparse.make_option("--build-directory",
help="Path to the directory under which build files are kept (should not include configuration)"),
optparse.make_option("--time-out-ms", default=30000,
optparse.make_option("--time-out-ms", default=600 * 1000,
help="Set the timeout for each test"),
optparse.make_option("--output-json-path",
help="Filename of the JSON file that summaries the results"),
Expand Down Expand Up @@ -171,7 +171,7 @@ def _run_tests_set(self, tests, port):
driver.stop()
driver = None
if not driver:
driver = port.create_driver(worker_number=1)
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)))
Expand Down
Expand Up @@ -108,7 +108,7 @@ def create_runner(self, buildbot_output=None, args=[]):

options, parsed_args = PerfTestsRunner._parse_args(args)
test_port = TestPort(host=MockHost(), options=options)
test_port.create_driver = lambda worker_number=None: MainTest.TestDriver()
test_port.create_driver = lambda worker_number=None, no_timeout=False: MainTest.TestDriver()

runner = PerfTestsRunner(regular_output, buildbot_output, args=args, port=test_port)
runner._host.filesystem.maybe_make_directory(runner._base_path, 'inspector')
Expand Down

0 comments on commit 780e1d3

Please sign in to comment.