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

ossy at webkit.org ossy at webkit.org
Wed Dec 22 14:02:08 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 124589779cd3d7d25a589533656bf4f74342c24c
Author: ossy at webkit.org <ossy at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 1 18:17:35 2010 +0000

    2010-10-01  Gabor Rapcsanyi  <rgabor at inf.u-szeged.hu>
    
            Reviewed by Tony Chang.
    
            [NRWT] Put the http and websocket tests first in the test list.
            https://bugs.webkit.org/show_bug.cgi?id=46453
    
            * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
            * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68903 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 782fb2e..32723a5 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,13 @@
+2010-10-01  Gabor Rapcsanyi  <rgabor at inf.u-szeged.hu>
+
+        Reviewed by Tony Chang.
+
+        [NRWT] Put the http and websocket tests first in the test list.
+        https://bugs.webkit.org/show_bug.cgi?id=46453
+
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+        * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
+
 2010-10-01  Fady Samuel  <fsamuel at chromium.org>
 
         Unreviewed, adding myself to the committer list.
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
index e9c6d2c..31a42f3 100755
--- a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
@@ -1,5 +1,6 @@
 #!/usr/bin/env python
 # Copyright (C) 2010 Google Inc. All rights reserved.
+# Copyright (C) 2010 Gabor Rapcsanyi (rgabor at inf.u-szeged.hu), University of Szeged
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are
@@ -498,6 +499,12 @@ class TestRunner:
                             self._options.slow_time_out_ms)
         return TestInfo(self._port, test_file, self._options.time_out_ms)
 
+    def _test_requires_lock(self, test_file):
+        """Return True if the test needs to be locked when
+        running multiple copies of NRWTs."""
+        split_path = test_file.split(os.sep)
+        return 'http' in split_path or 'websocket' in split_path
+
     def _get_test_file_queue(self, test_files):
         """Create the thread safe queue of lists of (test filenames, test URIs)
         tuples. Each TestShellThread pulls a list from this queue and runs
@@ -511,46 +518,46 @@ class TestRunner:
           The Queue of lists of TestInfo objects.
         """
 
+        test_lists = []
+        tests_to_http_lock = []
         if (self._options.experimental_fully_parallel or
             self._is_single_threaded()):
-            filename_queue = Queue.Queue()
             for test_file in test_files:
-                filename_queue.put(
-                    ('.', [self._get_test_info_for_file(test_file)]))
-            return filename_queue
-
-        tests_by_dir = {}
-        for test_file in test_files:
-            directory = self._get_dir_for_test_file(test_file)
-            tests_by_dir.setdefault(directory, [])
-            tests_by_dir[directory].append(
-                self._get_test_info_for_file(test_file))
-
-        # Sort by the number of tests in the dir so that the ones with the
-        # most tests get run first in order to maximize parallelization.
-        # Number of tests is a good enough, but not perfect, approximation
-        # of how long that set of tests will take to run. We can't just use
-        # a PriorityQueue until we move # to Python 2.6.
-        test_lists = []
-        http_tests = None
-        for directory in tests_by_dir:
-            test_list = tests_by_dir[directory]
-            # Keep the tests in alphabetical order.
-            # TODO: Remove once tests are fixed so they can be run in any
-            # order.
-            test_list.reverse()
-            test_list_tuple = (directory, test_list)
-            if directory == 'LayoutTests' + os.sep + 'http':
-                http_tests = test_list_tuple
-            else:
+                test_info = self._get_test_info_for_file(test_file)
+                if self._test_requires_lock(test_file):
+                    tests_to_http_lock.append(test_info)
+                else:
+                    test_lists.append((".", [test_info]))
+        else:
+            tests_by_dir = {}
+            for test_file in test_files:
+                directory = self._get_dir_for_test_file(test_file)
+                test_info = self._get_test_info_for_file(test_file)
+                if self._test_requires_lock(test_file):
+                    tests_to_http_lock.append(test_info)
+                else:
+                    tests_by_dir.setdefault(directory, [])
+                    tests_by_dir[directory].append(test_info)
+            # Sort by the number of tests in the dir so that the ones with the
+            # most tests get run first in order to maximize parallelization.
+            # Number of tests is a good enough, but not perfect, approximation
+            # of how long that set of tests will take to run. We can't just use
+            # a PriorityQueue until we move to Python 2.6.
+            for directory in tests_by_dir:
+                test_list = tests_by_dir[directory]
+                # Keep the tests in alphabetical order.
+                # FIXME: Remove once tests are fixed so they can be run in any
+                # order.
+                test_list.reverse()
+                test_list_tuple = (directory, test_list)
                 test_lists.append(test_list_tuple)
-        test_lists.sort(lambda a, b: cmp(len(b[1]), len(a[1])))
+            test_lists.sort(lambda a, b: cmp(len(b[1]), len(a[1])))
 
         # Put the http tests first. There are only a couple hundred of them,
         # but each http test takes a very long time to run, so sorting by the
         # number of tests doesn't accurately capture how long they take to run.
-        if http_tests:
-            test_lists.insert(0, http_tests)
+        if tests_to_http_lock:
+            test_lists.insert(0, ("tests_to_http_lock", tests_to_http_lock))
 
         filename_queue = Queue.Queue()
         for item in test_lists:
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
index 6fe99d6..7b8cf4d 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
@@ -1,5 +1,6 @@
 #!/usr/bin/python
 # Copyright (C) 2010 Google Inc. All rights reserved.
+# Copyright (C) 2010 Gabor Rapcsanyi (rgabor at inf.u-szeged.hu), University of Szeged
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are
@@ -294,6 +295,11 @@ class RebaselineTest(unittest.TestCase):
             codecs.open = original_open
 
 
+class TestRunnerWrapper(run_webkit_tests.TestRunner):
+    def _get_test_info_for_file(self, test_file):
+        return test_file
+
+
 class TestRunnerTest(unittest.TestCase):
     def test_results_html(self):
         mock_port = Mock()
@@ -314,6 +320,52 @@ class TestRunnerTest(unittest.TestCase):
         html = runner._results_html(["test_path"], {}, "Title", override_time="time")
         self.assertEqual(html, expected_html)
 
+    def queue_to_list(self, queue):
+        queue_list = []
+        while(True):
+            try:
+                queue_list.append(queue.get_nowait())
+            except Queue.Empty:
+                break
+        return queue_list
+
+    def test_get_test_file_queue(self):
+        # Test that _get_test_file_queue in run_webkit_tests.TestRunner really
+        # put the http tests first in the queue.
+        runner = TestRunnerWrapper(port=Mock(), options=Mock(), printer=Mock())
+        runner._options.experimental_fully_parallel = False
+
+        test_list = [
+          "LayoutTests/websocket/tests/unicode.htm",
+          "LayoutTests/animations/keyframes.html",
+          "LayoutTests/http/tests/security/view-source-no-refresh.html",
+          "LayoutTests/websocket/tests/websocket-protocol-ignored.html",
+          "LayoutTests/fast/css/display-none-inline-style-change-crash.html",
+          "LayoutTests/http/tests/xmlhttprequest/supported-xml-content-types.html",
+          "LayoutTests/dom/html/level2/html/HTMLAnchorElement03.html",
+          "LayoutTests/ietestcenter/Javascript/11.1.5_4-4-c-1.html",
+          "LayoutTests/dom/html/level2/html/HTMLAnchorElement06.html",
+        ]
+
+        expected_tests_to_http_lock = set([
+          'LayoutTests/websocket/tests/unicode.htm',
+          'LayoutTests/http/tests/security/view-source-no-refresh.html',
+          'LayoutTests/websocket/tests/websocket-protocol-ignored.html',
+          'LayoutTests/http/tests/xmlhttprequest/supported-xml-content-types.html',
+        ])
+
+        runner._options.child_processes = 1
+        test_queue_for_single_thread = runner._get_test_file_queue(test_list)
+        runner._options.child_processes = 2
+        test_queue_for_multi_thread = runner._get_test_file_queue(test_list)
+
+        single_thread_results = self.queue_to_list(test_queue_for_single_thread)
+        multi_thread_results = self.queue_to_list(test_queue_for_multi_thread)
+
+        self.assertEqual("tests_to_http_lock", single_thread_results[0][0])
+        self.assertEqual(expected_tests_to_http_lock, set(single_thread_results[0][1]))
+        self.assertEqual("tests_to_http_lock", multi_thread_results[0][0])
+        self.assertEqual(expected_tests_to_http_lock, set(multi_thread_results[0][1]))
 
 class DryrunTest(unittest.TestCase):
     # FIXME: it's hard to know which platforms are safe to test; the

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list