[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

aroben at apple.com aroben at apple.com
Wed Dec 22 13:57:56 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit e64339aaa648a99d5cb789b3e066fa8fee7a1a19
Author: aroben at apple.com <aroben at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Sep 30 16:40:27 2010 +0000

    Ensure that QueueEngine cleans up its log files when its delegate tells it to stop processing work
    
    Reviewed by Adam Barth.
    
    Fixes <http://webkit.org/b/46891> <rdar://problem/8496638> Many tests
    in webkitpy.tool.bot.queueengine_unittest.QueueEngineTest crash on
    Windows
    
    * Scripts/webkitpy/tool/bot/queueengine.py:
    (QueueEngine.run): Stop ourselves normally (including cleaning up log
    files) when the delegate tells us to stop processing work.
    
    * Scripts/webkitpy/tool/bot/queueengine_unittest.py:
    (LoggingDelegate.__init__): Moved code here from
    RaisingDelegate.__init__.
    (LoggingDelegate.expeced_callbacks): Added the stop_work_queue
    callback.
    (LoggingDelegate.stop_work_queue): Moved here from RaisingDelegate.
    (RaisingDelegate.__init__): Removed code that LoggingDelegate takes
    care of for us now.
    (QueueEngineTest.test_trivial): Make sure we got the expected stop
    message.
    (QueueEngineTest.test_not_safe_to_proceed): Changed to explicitly
    remove the callbacks that are related to processing a single work
    item, rather than removing all callbacks after a certain point, as
    there are now more callbacks we expect to receive at the end.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68793 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 449ed87..f2ce88a 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,5 +1,35 @@
 2010-09-30  Adam Roben  <aroben at apple.com>
 
+        Ensure that QueueEngine cleans up its log files when its delegate
+        tells it to stop processing work
+
+        Reviewed by Adam Barth.
+
+        Fixes <http://webkit.org/b/46891> <rdar://problem/8496638> Many tests
+        in webkitpy.tool.bot.queueengine_unittest.QueueEngineTest crash on
+        Windows
+
+        * Scripts/webkitpy/tool/bot/queueengine.py:
+        (QueueEngine.run): Stop ourselves normally (including cleaning up log
+        files) when the delegate tells us to stop processing work.
+
+        * Scripts/webkitpy/tool/bot/queueengine_unittest.py:
+        (LoggingDelegate.__init__): Moved code here from
+        RaisingDelegate.__init__.
+        (LoggingDelegate.expeced_callbacks): Added the stop_work_queue
+        callback.
+        (LoggingDelegate.stop_work_queue): Moved here from RaisingDelegate.
+        (RaisingDelegate.__init__): Removed code that LoggingDelegate takes
+        care of for us now.
+        (QueueEngineTest.test_trivial): Make sure we got the expected stop
+        message.
+        (QueueEngineTest.test_not_safe_to_proceed): Changed to explicitly
+        remove the callbacks that are related to processing a single work
+        item, rather than removing all callbacks after a certain point, as
+        there are now more callbacks we expect to receive at the end.
+
+2010-09-30  Adam Roben  <aroben at apple.com>
+
         Fix path -> URL conversion on Cygwin
 
         Reviewed by Adam Barth.
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/queueengine.py b/WebKitTools/Scripts/webkitpy/tool/bot/queueengine.py
index 8118653..8b016e8 100644
--- a/WebKitTools/Scripts/webkitpy/tool/bot/queueengine.py
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/queueengine.py
@@ -125,8 +125,8 @@ class QueueEngine:
                 traceback.print_exc()
                 # Don't try tell the status bot, in case telling it causes an exception.
                 self._sleep("Exception while preparing queue")
-        # Never reached.
-        self._ensure_work_log_closed()
+        self._stopping("Delegate terminated queue.")
+        return 0
 
     def _stopping(self, message):
         log("\n%s" % message)
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/queueengine_unittest.py b/WebKitTools/Scripts/webkitpy/tool/bot/queueengine_unittest.py
index bfec401..4027e11 100644
--- a/WebKitTools/Scripts/webkitpy/tool/bot/queueengine_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/queueengine_unittest.py
@@ -43,6 +43,7 @@ class LoggingDelegate(QueueEngineDelegate):
         self._test = test
         self._callbacks = []
         self._run_before = False
+        self.stop_message = None
 
     expected_callbacks = [
         'queue_log_path',
@@ -52,7 +53,8 @@ class LoggingDelegate(QueueEngineDelegate):
         'should_proceed_with_work_item',
         'work_item_log_path',
         'process_work_item',
-        'should_continue_work_queue'
+        'should_continue_work_queue',
+        'stop_work_queue',
     ]
 
     def record(self, method_name):
@@ -95,21 +97,20 @@ class LoggingDelegate(QueueEngineDelegate):
         self.record("handle_unexpected_error")
         self._test.assertEquals(work_item, "work_item")
 
+    def stop_work_queue(self, message):
+        self.record("stop_work_queue")
+        self.stop_message = message
+
 
 class RaisingDelegate(LoggingDelegate):
     def __init__(self, test, exception):
         LoggingDelegate.__init__(self, test)
         self._exception = exception
-        self.stop_message = None
 
     def process_work_item(self, work_item):
         self.record("process_work_item")
         raise self._exception
 
-    def stop_work_queue(self, message):
-        self.record("stop_work_queue")
-        self.stop_message = message
-
 
 class NotSafeToProceedDelegate(LoggingDelegate):
     def should_proceed_with_work_item(self, work_item):
@@ -134,6 +135,7 @@ class QueueEngineTest(unittest.TestCase):
         delegate = LoggingDelegate(self)
         work_queue = QueueEngine("trivial-queue", delegate, threading.Event())
         work_queue.run()
+        self.assertEquals(delegate.stop_message, "Delegate terminated queue.")
         self.assertEquals(delegate._callbacks, LoggingDelegate.expected_callbacks)
         self.assertTrue(os.path.exists(os.path.join(self.temp_dir, "queue_log_path")))
         self.assertTrue(os.path.exists(os.path.join(self.temp_dir, "work_log_path", "work_item.log")))
@@ -181,12 +183,8 @@ class QueueEngineTest(unittest.TestCase):
         work_queue = FastQueueEngine(delegate)
         work_queue.run()
         expected_callbacks = LoggingDelegate.expected_callbacks[:]
-        next_work_item_index = expected_callbacks.index('next_work_item')
-        # We slice out the common part of the expected callbacks.
-        # We add 2 here to include should_proceed_with_work_item, which is
-        # a pain to search for directly because it occurs twice.
-        expected_callbacks = expected_callbacks[:next_work_item_index + 2]
-        expected_callbacks.append('should_continue_work_queue')
+        expected_callbacks.remove('work_item_log_path')
+        expected_callbacks.remove('process_work_item')
         self.assertEquals(delegate._callbacks, expected_callbacks)
 
     def test_now(self):

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list