Changeset 114960 in webkit


Ignore:
Timestamp:
Apr 23, 2012 4:13:13 PM (12 years ago)
Author:
dpranke@chromium.org
Message:

run-perf-tests fail intermittently with an exception
https://bugs.webkit.org/show_bug.cgi?id=83532

Reviewed by Ryosuke Niwa.

This bulletproofs port.get_option('child_processes')
against the case where the option wasn't set.

  • Scripts/webkitpy/layout_tests/port/mac.py:

(MacPort._get_crash_log):

  • Scripts/webkitpy/layout_tests/port/mac_unittest.py:

(test_get_crash_log):
(test_get_crash_log.fake_time_cb):

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r114955 r114960  
     12012-04-23  Dirk Pranke  <dpranke@chromium.org>
     2
     3        run-perf-tests fail intermittently with an exception
     4        https://bugs.webkit.org/show_bug.cgi?id=83532
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        This bulletproofs port.get_option('child_processes')
     9        against the case where the option wasn't set.
     10
     11        * Scripts/webkitpy/layout_tests/port/mac.py:
     12        (MacPort._get_crash_log):
     13        * Scripts/webkitpy/layout_tests/port/mac_unittest.py:
     14        (test_get_crash_log):
     15        (test_get_crash_log.fake_time_cb):
     16
    1172012-04-23  Balazs Kelemen  <kbalazs@webkit.org>
    218
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/mac.py

    r114577 r114960  
    176176        pass
    177177
    178     def _get_crash_log(self, name, pid, stdout, stderr, newer_than):
     178    def _get_crash_log(self, name, pid, stdout, stderr, newer_than, time_fn=None, sleep_fn=None):
    179179        # Note that we do slow-spin here and wait, since it appears the time
    180180        # ReportCrash takes to actually write and flush the file varies when there are
    181181        # lots of simultaneous crashes going on.
    182182        # FIXME: Should most of this be moved into CrashLogs()?
     183        time_fn = time_fn or time.time
     184        sleep_fn = sleep_fn or time.sleep
    183185        crash_log = ''
    184186        crash_logs = CrashLogs(self._filesystem)
    185         now = time.time()
     187        now = time_fn()
    186188        # FIXME: delete this after we're sure this code is working ...
    187189        _log.debug('looking for crash log for %s:%s' % (name, str(pid)))
    188         deadline = now + 5 * int(self.get_option('child_processes'))
     190        deadline = now + 5 * int(self.get_option('child_processes', 1))
    189191        while not crash_log and now <= deadline:
    190192            crash_log = crash_logs.find_newest_log(name, pid, include_errors=True, newer_than=newer_than)
    191193            if not crash_log or not [line for line in crash_log.splitlines() if not line.startswith('ERROR')]:
    192                 time.sleep(0.1)
    193                 now = time.time()
     194                sleep_fn(0.1)
     195                now = time_fn()
    194196        if not crash_log:
    195197            crash_log = 'no crash log found for %s:%d' % (name, pid)
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/mac_unittest.py

    r111945 r114960  
    191191
    192192    def test_get_crash_log(self):
    193         # Mac crash logs are tested elsewhere
    194         pass
     193        # Mac crash logs are tested elsewhere, so here we just make sure we don't crash.
     194        def fake_time_cb():
     195            times = [0, 20, 40]
     196            return lambda: times.pop(0)
     197        port = self.make_port(port_name='mac-snowleopard')
     198        port._get_crash_log('DumpRenderTree', 1234, '', '', 0,
     199            time_fn=fake_time_cb(), sleep_fn=lambda delay: None)
    195200
    196201    def test_helper_starts(self):
Note: See TracChangeset for help on using the changeset viewer.