Title: [90651] trunk/Tools
Revision
90651
Author
[email protected]
Date
2011-07-08 12:21:41 -0700 (Fri, 08 Jul 2011)

Log Message

REGRESSION(90419) NRWT's httpd locking is broken for --child-processes=1
https://bugs.webkit.org/show_bug.cgi?id=64092

Reviewed by Tony Chang.

The code was incorrectly creating empty shards in the
shard_in_two case.

* Scripts/webkitpy/layout_tests/controllers/manager.py:
* Scripts/webkitpy/layout_tests/controllers/manager_unittest.py:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (90650 => 90651)


--- trunk/Tools/ChangeLog	2011-07-08 19:05:17 UTC (rev 90650)
+++ trunk/Tools/ChangeLog	2011-07-08 19:21:41 UTC (rev 90651)
@@ -1,3 +1,16 @@
+2011-07-08  Dirk Pranke  <[email protected]>
+
+        REGRESSION(90419) NRWT's httpd locking is broken for --child-processes=1
+        https://bugs.webkit.org/show_bug.cgi?id=64092
+
+        Reviewed by Tony Chang.
+
+        The code was incorrectly creating empty shards in the
+        shard_in_two case.
+
+        * Scripts/webkitpy/layout_tests/controllers/manager.py:
+        * Scripts/webkitpy/layout_tests/controllers/manager_unittest.py:
+
 2011-07-08  Adam Roben  <[email protected]>
 
         Teach buildbot to figure out how many webkitpy/webkitperl tests failed

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py (90650 => 90651)


--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py	2011-07-08 19:05:17 UTC (rev 90650)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py	2011-07-08 19:21:41 UTC (rev 90651)
@@ -569,8 +569,16 @@
                 locked_inputs.append(test_input)
             else:
                 unlocked_inputs.append(test_input)
-        return [TestShard('locked_tests', locked_inputs)], [TestShard('unlocked_tests', unlocked_inputs)]
 
+        locked_shards = []
+        unlocked_shards = []
+        if locked_inputs:
+            locked_shards = [TestShard('locked_tests', locked_inputs)]
+        if unlocked_inputs:
+            unlocked_shards = [TestShard('unlocked_tests', unlocked_inputs)]
+
+        return locked_shards, unlocked_shards
+
     def _shard_every_file(self, test_files):
         """Returns two lists of shards, each shard containing a single test file.
 

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py (90650 => 90651)


--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py	2011-07-08 19:05:17 UTC (rev 90650)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py	2011-07-08 19:21:41 UTC (rev 90651)
@@ -67,11 +67,12 @@
         "dom/html/level2/html/HTMLAnchorElement06.html",
     ]
 
-    def get_shards(self, num_workers, fully_parallel):
+    def get_shards(self, num_workers, fully_parallel, test_list=None):
+        test_list = test_list or self.test_list
         port = layout_tests.port.get(port_name='test')
         port._filesystem = filesystem_mock.MockFileSystem()
         self.manager = ManagerWrapper(port=port, options=Mock(), printer=Mock())
-        return self.manager._shard_tests(self.test_list, num_workers, fully_parallel)
+        return self.manager._shard_tests(test_list, num_workers, fully_parallel)
 
     def test_shard_by_dir(self):
         locked, unlocked = self.get_shards(num_workers=2, fully_parallel=False)
@@ -126,7 +127,19 @@
                         'ietestcenter/_javascript_/11.1.5_4-4-c-1.html',
                         'dom/html/level2/html/HTMLAnchorElement06.html'])])
 
+    def test_shard_in_two_has_no_locked_shards(self):
+        locked, unlocked = self.get_shards(num_workers=1, fully_parallel=False,
+             test_list=['animations/keyframe.html'])
+        self.assertEquals(len(locked), 0)
+        self.assertEquals(len(unlocked), 1)
 
+    def test_shard_in_two_has_no_unlocked_shards(self):
+        locked, unlocked = self.get_shards(num_workers=1, fully_parallel=False,
+             test_list=['http/tests/webcoket/tests/unicode.htm'])
+        self.assertEquals(len(locked), 1)
+        self.assertEquals(len(unlocked), 0)
+
+
 class ManagerTest(unittest.TestCase):
     def test_http_locking(tester):
         class LockCheckingManager(Manager):
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to