Title: [111902] trunk/Tools
Revision
111902
Author
[email protected]
Date
2012-03-23 14:09:57 -0700 (Fri, 23 Mar 2012)

Log Message

LayoutTestHelper could get torn down earlier (mostly to reset color profile)
https://bugs.webkit.org/show_bug.cgi?id=80567

Reviewed by Ryosuke Niwa.

Move clean_up_run to occur right after we finish testing and
before we start processing the results. Also makes set_up_run()
and clean_up_run() private since there's no real need for
callers to be aware of them.

* Scripts/webkitpy/layout_tests/controllers/manager.py:
(Manager._set_up_run):
(Manager.run):
(Manager._clean_up_run):
* Scripts/webkitpy/layout_tests/controllers/manager_unittest.py:
(ManagerTest.test_http_locking):
* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(run):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (111901 => 111902)


--- trunk/Tools/ChangeLog	2012-03-23 21:02:51 UTC (rev 111901)
+++ trunk/Tools/ChangeLog	2012-03-23 21:09:57 UTC (rev 111902)
@@ -1,3 +1,24 @@
+2012-03-23  Dirk Pranke  <[email protected]>
+
+        LayoutTestHelper could get torn down earlier (mostly to reset color profile)
+        https://bugs.webkit.org/show_bug.cgi?id=80567
+
+        Reviewed by Ryosuke Niwa.
+
+        Move clean_up_run to occur right after we finish testing and
+        before we start processing the results. Also makes set_up_run()
+        and clean_up_run() private since there's no real need for
+        callers to be aware of them.
+
+        * Scripts/webkitpy/layout_tests/controllers/manager.py:
+        (Manager._set_up_run):
+        (Manager.run):
+        (Manager._clean_up_run):
+        * Scripts/webkitpy/layout_tests/controllers/manager_unittest.py:
+        (ManagerTest.test_http_locking):
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+        (run):
+
 2012-03-23  Dean Jackson  <[email protected]>
 
         Disable CSS_SHADERS in Apple builds

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


--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py	2012-03-23 21:02:51 UTC (rev 111901)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py	2012-03-23 21:09:57 UTC (rev 111902)
@@ -836,7 +836,7 @@
     def needs_servers(self):
         return any(self._test_requires_lock(test_name) for test_name in self._test_files) and self._options.http
 
-    def set_up_run(self):
+    def _set_up_run(self):
         """Configures the system to be ready to run tests.
 
         Returns a ResultSummary object if we should continue to run tests,
@@ -870,7 +870,7 @@
 
         return result_summary
 
-    def run(self, result_summary):
+    def run(self):
         """Run all our tests on all our test files.
 
         For each test file, we run each test type. If there are any failures,
@@ -885,6 +885,11 @@
         # collect_tests() must have been called first to initialize us.
         # If we didn't find any files to test, we've errored out already in
         # prepare_lists_and_print_output().
+
+        result_summary = self._set_up_run()
+        if not result_summary:
+            return -1
+
         assert(len(self._test_files))
 
         start_time = time.time()
@@ -907,12 +912,11 @@
 
         end_time = time.time()
 
+        self._clean_up_run()
+
         self._print_timing_statistics(end_time - start_time, thread_timings, test_timings, individual_test_timings, result_summary)
         self._print_result_summary(result_summary)
 
-        sys.stdout.flush()
-        sys.stderr.flush()
-
         self._printer.print_one_line_summary(result_summary.total, result_summary.expected, result_summary.unexpected)
 
         unexpected_results = summarize_results(self._port, self._expectations, result_summary, retry_summary, individual_test_timings, _only_unexpected_=True, interrupted=interrupted)
@@ -958,9 +962,8 @@
             self._port.release_http_lock()
             self._has_http_lock = False
 
-    def clean_up_run(self):
+    def _clean_up_run(self):
         """Restores the system after we're done running tests."""
-
         _log.debug("flushing stdout")
         sys.stdout.flush()
         _log.debug("flushing stderr")

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


--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py	2012-03-23 21:02:51 UTC (rev 111901)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py	2012-03-23 21:09:57 UTC (rev 111902)
@@ -218,9 +218,7 @@
         manager = LockCheckingManager(port, options, printer)
         manager.collect_tests(args)
         manager.parse_expectations()
-        result_summary = manager.set_up_run()
-        num_unexpected_results = manager.run(result_summary)
-        manager.clean_up_run()
+        num_unexpected_results = manager.run()
         printer.cleanup()
         tester.assertEquals(num_unexpected_results, 0)
 

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py (111901 => 111902)


--- trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py	2012-03-23 21:02:51 UTC (rev 111901)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py	2012-03-23 21:09:57 UTC (rev 111902)
@@ -121,11 +121,8 @@
         printer.print_update("Parsing expectations ...")
         manager.parse_expectations()
 
-        result_summary = manager.set_up_run()
-        if result_summary:
-            unexpected_result_count = manager.run(result_summary)
-            manager.clean_up_run()
-            _log.debug("Testing completed, Exit status: %d" % unexpected_result_count)
+        unexpected_result_count = manager.run()
+        _log.debug("Testing completed, Exit status: %d" % unexpected_result_count)
     finally:
         printer.cleanup()
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to