Changeset 57381 in webkit
- Timestamp:
- Apr 9, 2010 4:19:39 PM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 6 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r57380 r57381 1 2010-04-09 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 new-run-webkit-tests should talk about DumpRenderTree not test_shell 6 https://bugs.webkit.org/show_bug.cgi?id=37371 7 8 test_shell is some strange Chromium thing. 9 DumpRenderTree (tm) is the real deal. 10 11 * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py: Added. 12 * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py: 13 * Scripts/webkitpy/layout_tests/layout_package/test_failures.py: 14 * Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py: Removed. 15 * Scripts/webkitpy/layout_tests/port/chromium.py: 16 * Scripts/webkitpy/layout_tests/port/server_process.py: 17 * Scripts/webkitpy/layout_tests/run_webkit_tests.py: 18 1 19 2010-04-09 Zoltan Horvath <zoltan@webkit.org> 2 20 -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py
r57380 r57381 28 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 29 30 """A Thread object for running the test shelland processing URLs from a30 """A Thread object for running DumpRenderTree and processing URLs from a 31 31 shared queue. 32 32 33 Each thread runs a separate instance of the test_shellbinary and validates33 Each thread runs a separate instance of the DumpRenderTree binary and validates 34 34 the output. When there are no more URLs to process in the shared queue, the 35 35 thread exits. … … 49 49 50 50 _log = logging.getLogger("webkitpy.layout_tests.layout_package." 51 " test_shell_thread")51 "dump_render_tree_thread") 52 52 53 53 … … 55 55 output_dir, crash, timeout, test_run_time, actual_checksum, 56 56 output, error): 57 """Receives the output from a test_shellprocess, subjects it to a number57 """Receives the output from a DumpRenderTree process, subjects it to a number 58 58 of tests, and returns a list of failure types the test produced. 59 59 60 60 Args: 61 61 port: port-specific hooks 62 proc: an active test_shellprocess62 proc: an active DumpRenderTree process 63 63 test_info: Object containing the test filename, uri and timeout 64 64 test_types: list of test types to subject the output to … … 172 172 def __init__(self, port, filename_list_queue, result_queue, 173 173 test_types, test_args, image_path, shell_args, options): 174 """Initialize all the local state for this test shellthread.174 """Initialize all the local state for this DumpRenderTree thread. 175 175 176 176 Args: … … 183 183 against. 184 184 test_args: A TestArguments object to pass to each TestType. 185 shell_args: Any extra arguments to be passed to test_shell.exe.185 shell_args: Any extra arguments to be passed to DumpRenderTree. 186 186 options: A property dictionary as produced by optparse. The 187 187 command-line options should match those expected by … … 305 305 self._filename_list_queue.get_nowait() 306 306 except Queue.Empty: 307 self._kill_ test_shell()307 self._kill_dump_render_tree() 308 308 tests_run_file.close() 309 309 return … … 325 325 tests_run_file.write(filename + "\n") 326 326 if failures: 327 # Check and kill test shellif we need too.328 if len([1 for f in failures if f.should_kill_ test_shell()]):329 self._kill_ test_shell()327 # Check and kill DumpRenderTree if we need too. 328 if len([1 for f in failures if f.should_kill_dump_render_tree()]): 329 self._kill_dump_render_tree() 330 330 # Reset the batch count since the shell just bounced. 331 331 batch_count = 0 … … 342 342 if batch_size > 0 and batch_count > batch_size: 343 343 # Bounce the shell and reset count. 344 self._kill_ test_shell()344 self._kill_dump_render_tree() 345 345 batch_count = 0 346 346 … … 371 371 worker.start() 372 372 373 # When we're running one test per test_shellprocess, we can enforce374 # a hard timeout. the test_shellwatchdog uses 2.5x the timeout373 # When we're running one test per DumpRenderTree process, we can enforce 374 # a hard timeout. the DumpRenderTree watchdog uses 2.5x the timeout 375 375 # We want to be larger than that. 376 376 worker.join(int(test_info.timeout) * 3.0 / 1000.0) 377 377 if worker.isAlive(): 378 378 # If join() returned with the thread still running, the 379 # test_shell.exe is completely hung and there's nothing379 # DumpRenderTree is completely hung and there's nothing 380 380 # more we can do with it. We have to kill all the 381 # test_shells to free it up. If we're running more than382 # one test_shellthread, we'll end up killing the other383 # test_shells too, introducing spurious crashes. We accept that381 # DumpRenderTrees to free it up. If we're running more than 382 # one DumpRenderTree thread, we'll end up killing the other 383 # DumpRenderTrees too, introducing spurious crashes. We accept that 384 384 # tradeoff in order to avoid losing the rest of this thread's 385 385 # results. 386 _log.error('Test thread hung: killing all test_shells')386 _log.error('Test thread hung: killing all DumpRenderTrees') 387 387 worker._driver.stop() 388 388 … … 399 399 400 400 def _run_test(self, test_info): 401 """Run a single test file using a shared test_shellprocess.401 """Run a single test file using a shared DumpRenderTree process. 402 402 403 403 Args: … … 407 407 A list of TestFailure objects describing the error. 408 408 """ 409 self._ensure_ test_shell_is_running()409 self._ensure_dump_render_tree_is_running() 410 410 # The pixel_hash is used to avoid doing an image dump if the 411 411 # checksums match, so it should be set to a blank value if we … … 429 429 return stats.failures 430 430 431 def _ensure_ test_shell_is_running(self):432 """Start the shared test shell, if it's not running. Not for use when433 running tests singly, since those each start a separate test shellin431 def _ensure_dump_render_tree_is_running(self): 432 """Start the shared DumpRenderTree, if it's not running. Not for use when 433 running tests singly, since those each start a separate DumpRenderTree in 434 434 their own thread. 435 435 """ … … 438 438 self._image_path, self._shell_args) 439 439 440 def _kill_ test_shell(self):441 """Kill the test shellprocess if it's running."""440 def _kill_dump_render_tree(self): 441 """Kill the DumpRenderTree process if it's running.""" 442 442 if self._driver: 443 443 self._driver.stop() -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py
r57173 r57381 272 272 IMAGE_PLUS_TEXT: ('image and text mismatch', 273 273 'image and text mismatch'), 274 CRASH: (' test shellcrash',275 ' test shellcrashes'),274 CRASH: ('DumpRenderTree crash', 275 'DumpRenderTree crashes'), 276 276 TIMEOUT: ('test timed out', 'tests timed out'), 277 277 MISSING: ('no expected result found', -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py
r54328 r57381 80 80 raise NotImplemented 81 81 82 def should_kill_ test_shell(self):83 """Returns True if we should kill the test shellbefore the next82 def should_kill_dump_render_tree(self): 83 """Returns True if we should kill DumpRenderTree before the next 84 84 test.""" 85 85 return False … … 146 146 147 147 class FailureTimeout(TestFailure): 148 """Test timed out. We also want to restart the test shellif this148 """Test timed out. We also want to restart DumpRenderTree if this 149 149 happens.""" 150 150 … … 156 156 return "<strong>%s</strong>" % self.message() 157 157 158 def should_kill_ test_shell(self):158 def should_kill_dump_render_tree(self): 159 159 return True 160 160 … … 173 173 stack) 174 174 175 def should_kill_ test_shell(self):175 def should_kill_dump_render_tree(self): 176 176 return True 177 177 -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
r57256 r57381 77 77 def check_build(self, needs_http): 78 78 result = True 79 test_shell_binary_path = self._path_to_driver()80 result = check_file_exists( test_shell_binary_path,79 dump_render_tree_binary_path = self._path_to_driver() 80 result = check_file_exists(dump_render_tree_binary_path, 81 81 'test driver') 82 82 if result: … … 98 98 99 99 def check_sys_deps(self, needs_http): 100 test_shell_binary_path = self._path_to_driver()101 proc = subprocess.Popen([ test_shell_binary_path,100 dump_render_tree_binary_path = self._path_to_driver() 101 proc = subprocess.Popen([dump_render_tree_binary_path, 102 102 '--check-layout-test-sys-deps']) 103 103 if proc.wait(): … … 135 135 def setup_test_run(self): 136 136 # Delete the disk cache if any to ensure a clean test run. 137 test_shell_binary_path = self._path_to_driver()138 cachedir = os.path.split( test_shell_binary_path)[0]137 dump_render_tree_binary_path = self._path_to_driver() 138 cachedir = os.path.split(dump_render_tree_binary_path)[0] 139 139 cachedir = os.path.join(cachedir, "cache") 140 140 if os.path.exists(cachedir): … … 214 214 release_mtime > debug_mtime and configuration == 'Debug'): 215 215 _log.warning('You are not running the most ' 216 'recent test_shellbinary. You need to '216 'recent DumpRenderTree binary. You need to ' 217 217 'pass --debug or not to select between ' 218 218 'Debug and Release.') … … 257 257 258 258 # We need to pass close_fds=True to work around Python bug #2320 259 # (otherwise we can hang when we kill test_shellwhen we are running259 # (otherwise we can hang when we kill DumpRenderTree when we are running 260 260 # multiple threads). See http://bugs.python.org/issue2320 . 261 261 # Note that close_fds isn't supported on Windows, but this bug only … … 295 295 # This is hex code 0xc000001d, which is used for abrupt 296 296 # termination. This happens if we hit ctrl+c from the prompt 297 # and we happen to be waiting on the test_shell.297 # and we happen to be waiting on the DumpRenderTree. 298 298 # sdoyon: Not sure for which OS and in what circumstances the 299 299 # above code is valid. What works for me under Linux to detect … … 337 337 # Closing stdin/stdout/stderr hangs sometimes on OS X, 338 338 # (see __init__(), above), and anyway we don't want to hang 339 # the harness if test_shellis buggy, so we wait a couple340 # seconds to give test_shella chance to clean up, but then339 # the harness if DumpRenderTree is buggy, so we wait a couple 340 # seconds to give DumpRenderTree a chance to clean up, but then 341 341 # force-kill the process if necessary. 342 342 KILL_TIMEOUT = 3.0 -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/server_process.py
r56647 r57381 87 87 # This is hex code 0xc000001d, which is used for abrupt 88 88 # termination. This happens if we hit ctrl+c from the prompt 89 # and we happen to be waiting on the test_shell.89 # and we happen to be waiting on the DumpRenderTree. 90 90 # sdoyon: Not sure for which OS and in what circumstances the 91 91 # above code is valid. What works for me under Linux to detect … … 206 206 # Closing stdin/stdout/stderr hangs sometimes on OS X, 207 207 # (see restart(), above), and anyway we don't want to hang 208 # the harness if test_shellis buggy, so we wait a couple209 # seconds to give test_shella chance to clean up, but then208 # the harness if DumpRenderTree is buggy, so we wait a couple 209 # seconds to give DumpRenderTree a chance to clean up, but then 210 210 # force-kill the process if necessary. 211 211 KILL_TIMEOUT = 3.0 -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
r57265 r57381 28 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 29 30 """Run layout tests using the test_shell.30 """Run layout tests using DumpRenderTree. 31 31 32 32 This is a port of the existing webkit test script run-webkit-tests. … … 65 65 from layout_package import metered_stream 66 66 from layout_package import test_failures 67 from layout_package import test_shell_thread67 from layout_package import dump_render_tree_thread 68 68 from layout_package import test_files 69 69 from test_types import fuzzy_image_diff … … 165 165 # The per-test timeout in milliseconds, if no --time-out-ms option was 166 166 # given to run_webkit_tests. This should correspond to the default timeout 167 # in test_shell.exe.167 # in DumpRenderTree. 168 168 DEFAULT_TEST_TIMEOUT_MS = 6 * 1000 169 169 … … 476 476 return filename_queue 477 477 478 def _get_ test_shell_args(self, index):479 """Returns the tuple of arguments for tests and for test_shell."""478 def _get_dump_render_tree_args(self, index): 479 """Returns the tuple of arguments for tests and for DumpRenderTree.""" 480 480 shell_args = [] 481 481 test_args = test_type_base.TestArguments() … … 505 505 return False 506 506 507 def _instantiate_ test_shell_threads(self, test_files, result_summary):507 def _instantiate_dump_render_tree_threads(self, test_files, result_summary): 508 508 """Instantitates and starts the TestShellThread(s). 509 509 … … 515 515 # Instantiate TestShellThreads and start them. 516 516 threads = [] 517 for i in xrange(int(self._options.num_ test_shells)):517 for i in xrange(int(self._options.num_dump_render_trees)): 518 518 # Create separate TestTypes instances for each thread. 519 519 test_types = [] … … 522 522 self._options.results_directory)) 523 523 524 test_args, png_path, shell_args = self._get_ test_shell_args(i)525 thread = test_shell_thread.TestShellThread(self._port,526 filename_queue,527 self._result_queue,528 test_types,529 test_args,530 png_path,531 shell_args,532 self._options)524 test_args, png_path, shell_args = self._get_dump_render_tree_args(i) 525 thread = dump_render_tree_thread.TestShellThread(self._port, 526 filename_queue, 527 self._result_queue, 528 test_types, 529 test_args, 530 png_path, 531 shell_args, 532 self._options) 533 533 if self._is_single_threaded(): 534 534 thread.run_in_main_thread(self, result_summary) … … 541 541 def _is_single_threaded(self): 542 542 """Returns whether we should run all the tests in the main thread.""" 543 return int(self._options.num_ test_shells) == 1543 return int(self._options.num_dump_render_trees) == 1 544 544 545 545 def _run_tests(self, file_list, result_summary): … … 557 557 result_summary: summary object to populate with the results 558 558 """ 559 self._meter.update('Starting test shells ...')560 threads = self._instantiate_ test_shell_threads(file_list,561 result_summary)559 self._meter.update('Starting DumpRenderTrees ...') 560 threads = self._instantiate_dump_render_tree_threads(file_list, 561 result_summary) 562 562 563 563 # Wait for the threads to finish and collect test failures. … … 684 684 685 685 # Write the summary to disk (results.html) and maybe open the 686 # test_shellto this file.686 # DumpRenderTree to this file. 687 687 wrote_results = self._write_results_html_file(result_summary) 688 688 if not self._options.noshow_results and wrote_results: … … 958 958 cuml_time += t['total_time'] 959 959 write(" %6.2f cumulative, %6.2f optimal" % 960 (cuml_time, cuml_time / int(self._options.num_ test_shells)))960 (cuml_time, cuml_time / int(self._options.num_dump_render_trees))) 961 961 write("") 962 962 … … 971 971 write: A callback to write info to (e.g., a LoggingWriter) or 972 972 sys.stdout.write. 973 individual_test_timings: List of test_shell_thread.TestStats for all973 individual_test_timings: List of dump_render_tree_thread.TestStats for all 974 974 tests. 975 975 """ 976 976 test_types = individual_test_timings[0].time_for_diffs.keys() 977 times_for_ test_shell= []977 times_for_dump_render_tree = [] 978 978 times_for_diff_processing = [] 979 979 times_per_test_type = {} … … 982 982 983 983 for test_stats in individual_test_timings: 984 times_for_ test_shell.append(test_stats.test_run_time)984 times_for_dump_render_tree.append(test_stats.test_run_time) 985 985 times_for_diff_processing.append( 986 986 test_stats.total_time_for_all_diffs) … … 991 991 992 992 self._print_statistics_for_test_timings(write, 993 "PER TEST TIME IN TESTSHELL (seconds):", times_for_ test_shell)993 "PER TEST TIME IN TESTSHELL (seconds):", times_for_dump_render_tree) 994 994 self._print_statistics_for_test_timings(write, 995 995 "PER TEST DIFF PROCESSING TIMES (seconds):", … … 1006 1006 write: A callback to write info to (e.g., a LoggingWriter) or 1007 1007 sys.stdout.write. 1008 individual_test_timings: List of test_shell_thread.TestStats for all1008 individual_test_timings: List of dump_render_tree_thread.TestStats for all 1009 1009 tests. 1010 1010 result_summary: summary object for test run 1011 1011 """ 1012 # Reverse-sort by the time spent in test_shell.1012 # Reverse-sort by the time spent in DumpRenderTree. 1013 1013 individual_test_timings.sort(lambda a, b: 1014 1014 cmp(b.test_run_time, a.test_run_time)) … … 1331 1331 1332 1332 def _show_results_html_file(self): 1333 """ Launches the test shell open tothe results.html page."""1333 """Shows the results.html page.""" 1334 1334 results_filename = os.path.join(self._options.results_directory, 1335 1335 "results.html") … … 1422 1422 ignore_errors=True) 1423 1423 1424 if not options.num_ test_shells:1424 if not options.num_dump_render_trees: 1425 1425 # TODO(ojan): Investigate perf/flakiness impact of using numcores + 1. 1426 options.num_ test_shells = port_obj.num_cores()1426 options.num_dump_render_trees = port_obj.num_cores() 1427 1427 1428 1428 write = create_logging_writer(options, 'config') 1429 write("Running %s test_shells in parallel" % options.num_test_shells)1429 write("Running %s DumpRenderTrees in parallel" % options.num_dump_render_trees) 1430 1430 1431 1431 if not options.time_out_ms: … … 1544 1544 "whatever's already there.") 1545 1545 option_parser.add_option("", "--noshow-results", action="store_true", 1546 default=False, help="don't launch the test_shell"1546 default=False, help="don't launch DumpRenderTree" 1547 1547 " with results after the tests are done") 1548 1548 option_parser.add_option("", "--full-results-html", action="store_true", … … 1560 1560 help="Run all tests, even those marked SKIP " 1561 1561 "in the test list") 1562 option_parser.add_option("", "--num- test-shells",1563 help="Number of testshells to run in parallel.")1562 option_parser.add_option("", "--num-dump_render_trees", 1563 help="Number of DumpRenderTrees to run in parallel.") 1564 1564 option_parser.add_option("", "--use-apache", action="store_true", 1565 1565 default=False, … … 1569 1569 option_parser.add_option("", "--run-singly", action="store_true", 1570 1570 default=False, 1571 help="run a separate test_shellfor each test")1571 help="run a separate DumpRenderTree for each test") 1572 1572 option_parser.add_option("", "--num-slow-tests-to-log", default=50, 1573 1573 help="Number of slow tests whose timings " … … 1598 1598 option_parser.add_option("", "--startup-dialog", action="store_true", 1599 1599 default=False, 1600 help="create a dialog on test_shell.exe startup")1600 help="create a dialog on DumpRenderTree startup") 1601 1601 option_parser.add_option("", "--gp-fault-error-box", action="store_true", 1602 1602 default=False, … … 1604 1604 option_parser.add_option("", "--wrapper", 1605 1605 help="wrapper command to insert before " 1606 "invocations of test_shell; option is split "1606 "invocations of DumpRenderTree; option is split " 1607 1607 "on whitespace before running. (Example: " 1608 1608 "--wrapper='valgrind --smc-check=all')") … … 1629 1629 default=None, 1630 1630 help=("Run a the tests in batches (n), after " 1631 "every n tests, the test shellis "1631 "every n tests, DumpRenderTree is " 1632 1632 "relaunched.")) 1633 1633 option_parser.add_option("", "--builder-name",
Note: See TracChangeset
for help on using the changeset viewer.