Changeset 80284 in webkit


Ignore:
Timestamp:
Mar 3, 2011 2:18:54 PM (13 years ago)
Author:
mihaip@chromium.org
Message:

2011-03-03 Mihai Parparita <mihaip@chromium.org>

Reviewed by Tony Chang.

NRWT: AttributeError: TestRunner2 instance has no attribute '_cancel_workers'
https://bugs.webkit.org/show_bug.cgi?id=55694

Fixes for interruptions in NRWT:

  • Make TestRunInterruptedException be pickleable correctly (the base Exception class defines a reduce that does not include the reason)
  • Fix ordering of returned arguments from TestRunner2._run_tests (interrupted and keyboard_interrupted were reversed)
  • Fix cancel_workers callsites (was using old name).
  • In handle_exception re-raise actual exception instance that was thrown
  • Scripts/webkitpy/layout_tests/layout_package/test_runner.py:
  • Scripts/webkitpy/layout_tests/layout_package/test_runner2.py:
  • Scripts/webkitpy/layout_tests/layout_package/worker.py:
  • Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
Location:
trunk/Tools
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r80267 r80284  
     12011-03-03  Mihai Parparita  <mihaip@chromium.org>
     2
     3        Reviewed by Tony Chang.
     4
     5        NRWT: AttributeError: TestRunner2 instance has no attribute '_cancel_workers'
     6        https://bugs.webkit.org/show_bug.cgi?id=55694
     7       
     8        Fixes for interruptions in NRWT:
     9        - Make TestRunInterruptedException be pickleable correctly (the base
     10          Exception class defines a __reduce__ that does not include the reason)
     11        - Fix ordering of returned arguments from TestRunner2._run_tests
     12          (interrupted and keyboard_interrupted were reversed)
     13        - Fix cancel_workers callsites (was using old name).
     14        - In handle_exception re-raise actual exception instance that was thrown
     15
     16        * Scripts/webkitpy/layout_tests/layout_package/test_runner.py:
     17        * Scripts/webkitpy/layout_tests/layout_package/test_runner2.py:
     18        * Scripts/webkitpy/layout_tests/layout_package/worker.py:
     19        * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
     20
    1212011-03-03  Qi Zhang  <qi.2.zhang@nokia.com>
    222
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/test_runner.py

    r80090 r80284  
    163163    def __init__(self, reason):
    164164        self.reason = reason
     165
     166    def __reduce__(self):
     167        return self.__class__, (self.reason,)
    165168
    166169
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/test_runner2.py

    r78930 r80284  
    101101        """Runs the tests in the file_list.
    102102
    103         Return: A tuple (keyboard_interrupted, thread_timings, test_timings,
    104             individual_test_timings)
     103        Return: A tuple (interrupted, keyboard_interrupted, thread_timings,
     104            test_timings, individual_test_timings)
     105            interrupted is whether the run was interrupted
    105106            keyboard_interrupted is whether someone typed Ctrl^C
    106107            thread_timings is a list of dicts with the total runtime
     
    178179        except KeyboardInterrupt:
    179180            _log.info("Interrupted, exiting")
    180             self._cancel_workers()
     181            self.cancel_workers()
    181182            keyboard_interrupted = True
    182183        except test_runner.TestRunInterruptedException, e:
    183184            _log.info(e.reason)
    184             self._cancel_workers()
     185            self.cancel_workers()
    185186            interrupted = True
    186187        except:
     
    192193
    193194        # FIXME: should this be a class instead of a tuple?
    194         return (keyboard_interrupted, interrupted, thread_timings,
     195        return (interrupted, keyboard_interrupted, thread_timings,
    195196                self._group_stats, self._all_results)
    196197
     
    209210
    210211    def handle_exception(self, source, exception_info):
    211         raise exception_info
     212        exception_type, exception_value, exception_traceback = exception_info
     213        raise exception_type, exception_value, exception_traceback
    212214
    213215    def handle_finished_list(self, source, list_name, num_tests, elapsed_time):
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/worker.py

    r78512 r80284  
    8383            _log.debug("%s done%s" % (self._name, exception_msg))
    8484            if exception_msg:
    85                 exc_info = sys.exc_info()
    86                 stack_utils.log_traceback(_log.error, exc_info[2])
     85                exception_type, exception_value, exception_traceback = sys.exc_info()
     86                stack_utils.log_traceback(_log.error, exception_traceback)
    8787                # FIXME: Figure out how to send a message with a traceback.
    8888                self._worker_connection.post_message('exception',
    89                     (exc_info[0], exc_info[1], None))
     89                    (exception_type, exception_value, None))
    9090            self._worker_connection.post_message('done')
    9191
  • trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py

    r79973 r80284  
    237237            ['failures/expected/keyboard.html'], tests_included=True)
    238238
     239    def test_keyboard_interrupt_inline_worker_model(self):
     240        self.assertRaises(KeyboardInterrupt, logging_run,
     241            ['failures/expected/keyboard.html', '--worker-model', 'inline'],
     242            tests_included=True)
     243
    239244    def test_last_results(self):
    240245        fs = port.unit_test_filesystem()
     
    416421            flatten_batches=True)
    417422        self.assertEquals(['failures/expected/crash.html', 'passes/text.html'], tests_run)
     423
     424    def test_exit_after_n_crashes_inline_worker_model(self):
     425        tests_run = get_tests_run([
     426                'failures/unexpected/timeout.html',
     427                'passes/text.html',
     428                '--exit-after-n-crashes-or-timeouts', '1',
     429                '--worker-model', 'inline',
     430            ],
     431            tests_included=True,
     432            flatten_batches=True)
     433        self.assertEquals(['failures/unexpected/timeout.html'], tests_run)
    418434
    419435    def test_results_directory_absolute(self):
Note: See TracChangeset for help on using the changeset viewer.