Changeset 78512 in webkit


Ignore:
Timestamp:
Feb 14, 2011 2:58:21 PM (13 years ago)
Author:
dpranke@chromium.org
Message:

2011-02-14 Dirk Pranke <dpranke@chromium.org>

Reviewed by Mihai Parparita.

This patch modifies NRWT's Worker clas to use the new
WorkerMixin class to actually run tests. With this patch, the
multiprocess version of NRWT is fully functional and just needs
the values for --worker-model and --child-processes to be corrected
in the port/* classes to start using the new code by default.

https://bugs.webkit.org/show_bug.cgi?id=54082

  • Scripts/webkitpy/layout_tests/layout_package/worker.py:
Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r78511 r78512  
     12011-02-14  Dirk Pranke  <dpranke@chromium.org>
     2
     3        Reviewed by Mihai Parparita.
     4
     5        This patch modifies NRWT's Worker clas to use the new
     6        WorkerMixin class to actually run tests. With this patch, the
     7        multiprocess version of NRWT is fully functional and just needs
     8        the values for --worker-model and --child-processes to be corrected
     9        in the port/* classes to start using the new code by default.
     10
     11        https://bugs.webkit.org/show_bug.cgi?id=54082
     12
     13        * Scripts/webkitpy/layout_tests/layout_package/worker.py:
     14
    1152011-02-14  Dirk Pranke  <dpranke@chromium.org>
    216
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/worker.py

    r78506 r78512  
    3636
    3737from webkitpy.layout_tests.layout_package import manager_worker_broker
    38 from webkitpy.layout_tests.layout_package import test_results
     38from webkitpy.layout_tests.layout_package import worker_mixin
    3939
    4040
     
    4242
    4343
    44 class Worker(manager_worker_broker.AbstractWorker):
     44class Worker(manager_worker_broker.AbstractWorker, worker_mixin.WorkerMixin):
    4545    def __init__(self, worker_connection, worker_number, options):
    4646        self._worker_connection = worker_connection
     
    5252        self._port = None
    5353
    54     def _deferred_init(self, port):
    55         self._port = port
     54    def __del__(self):
     55        self.cleanup()
    5656
    5757    def cancel(self):
     
    6666
    6767    def run(self, port):
    68         self._deferred_init(port)
     68        self.safe_init(port)
    6969
    7070        exception_msg = ""
     
    9191
    9292    def handle_test_list(self, src, list_name, test_list):
    93         # FIXME: check to see if we need to get the http lock.
     93        if list_name == "tests_to_http_lock":
     94            self.start_servers_with_lock()
    9495
    9596        start_time = time.time()
     
    103104        self._worker_connection.post_message('finished_list', list_name, num_tests, elapsed_time)
    104105
    105         # FIXME: release the lock if necessary
     106        if self._has_http_lock:
     107            self.stop_servers_with_lock()
    106108
    107109    def handle_stop(self, src):
     
    109111
    110112    def _run_test(self, test_input):
    111 
    112         # FIXME: get real timeout value from SingleTestRunner
    113         test_timeout_sec = int(test_input.timeout) / 1000
     113        test_timeout_sec = self.timeout(test_input)
    114114        start = time.time()
    115115        self._worker_connection.post_message('started_test', test_input, test_timeout_sec)
    116116
    117         # FIXME: actually run the test.
    118         result = test_results.TestResult(test_input.filename, failures=[],
    119             test_run_time=0, total_time_for_all_diffs=0, time_for_diffs={})
     117        result = self.run_test_with_timeout(test_input, test_timeout_sec)
    120118
    121119        elapsed_time = time.time() - start
     120        self._worker_connection.post_message('finished_test', result, elapsed_time)
    122121
    123         # FIXME: update stats, check for failures.
    124 
    125         self._worker_connection.post_message('finished_test', result, elapsed_time)
     122        self.clean_up_after_test(test_input, result)
Note: See TracChangeset for help on using the changeset viewer.