Title: [87591] trunk/Tools
Revision
87591
Author
dpra...@chromium.org
Date
2011-05-27 18:56:23 -0700 (Fri, 27 May 2011)

Log Message

2011-05-27  Dirk Pranke  <dpra...@chromium.org>

        Reviewed by Ojan Vafai.

        NRWT: debug messages from the workers are being logged twice
        https://bugs.webkit.org/show_bug.cgi?id=60428

        It looks like when the workers are run in separate processes
        we end up getting two copies of every log message they print.
        This has to do with the multiprocessing module on UNIX cloning
        the log configuration in a way I wasn't expecting, and so two
        log handlers end up getting registered.

        * Scripts/webkitpy/layout_tests/layout_package/manager_worker_broker.py:
        * Scripts/webkitpy/layout_tests/layout_package/printing.py:
        * Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py:
        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (87590 => 87591)


--- trunk/Tools/ChangeLog	2011-05-28 01:24:21 UTC (rev 87590)
+++ trunk/Tools/ChangeLog	2011-05-28 01:56:23 UTC (rev 87591)
@@ -1,3 +1,21 @@
+2011-05-27  Dirk Pranke  <dpra...@chromium.org>
+
+        Reviewed by Ojan Vafai.
+
+        NRWT: debug messages from the workers are being logged twice
+        https://bugs.webkit.org/show_bug.cgi?id=60428
+
+        It looks like when the workers are run in separate processes
+        we end up getting two copies of every log message they print.
+        This has to do with the multiprocessing module on UNIX cloning
+        the log configuration in a way I wasn't expecting, and so two
+        log handlers end up getting registered.
+
+        * Scripts/webkitpy/layout_tests/layout_package/manager_worker_broker.py:
+        * Scripts/webkitpy/layout_tests/layout_package/printing.py:
+        * Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py:
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
 2011-05-27  Adam Roben  <aro...@apple.com>
 
         Always decode tester names from location.hash

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/manager_worker_broker.py (87590 => 87591)


--- trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/manager_worker_broker.py	2011-05-28 01:24:21 UTC (rev 87590)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/manager_worker_broker.py	2011-05-28 01:56:23 UTC (rev 87591)
@@ -319,11 +319,18 @@
         def run(self):
             options = self._options
             port_obj = port.get(self._platform_name, options)
+
+            # The unix multiprocessing implementation clones the
+            # log handler configuration into the child processes,
+            # but the win implementation doesn't.
+            configure_logging = (sys.platform == 'win32')
+
             # FIXME: this won't work if the calling process is logging
             # somewhere other than sys.stderr and sys.stdout, but I'm not sure
             # if this will be an issue in practice.
             printer = printing.Printer(port_obj, options, sys.stderr, sys.stdout,
-                int(options.child_processes), options.experimental_fully_parallel)
+                int(options.child_processes), options.experimental_fully_parallel,
+                configure_logging)
             self._client.run(port_obj)
             printer.cleanup()
 

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/printing.py (87590 => 87591)


--- trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/printing.py	2011-05-28 01:24:21 UTC (rev 87590)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/printing.py	2011-05-28 01:56:23 UTC (rev 87591)
@@ -210,7 +210,7 @@
     By default the buildbot-parsed code gets logged to stdout, and regular
     output gets logged to stderr."""
     def __init__(self, port, options, regular_output, buildbot_output,
-                 child_processes, is_fully_parallel):
+                 child_processes, is_fully_parallel, configure_logging):
         """
         Args
           port               interface to port-specific routines
@@ -224,8 +224,9 @@
           is_fully_parallel  are the tests running in a single queue, or
                              in shards (usually controlled by
                              --experimental-fully-parallel)
+          configure_loggign  Whether a logging handler should be registered
 
-        Note that the last two args are separate rather than bundled into
+        Note that the fourth and fifth args are separate rather than bundled into
         the options structure so that this object does not assume any flags
         set in options that weren't returned from logging_options(), above.
         The two are used to determine whether or not we can sensibly use
@@ -244,8 +245,9 @@
 
         self._meter = metered_stream.MeteredStream(options.verbose,
                                                    regular_output)
-        self._logging_handler = _configure_logging(self._meter,
-            options.verbose)
+        self._logging_handler = None
+        if configure_logging:
+            self._logging_handler = _configure_logging(self._meter, options.verbose)
 
         self.switches = parse_print_options(options.print_options,
             options.verbose, child_processes, is_fully_parallel)

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py (87590 => 87591)


--- trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py	2011-05-28 01:24:21 UTC (rev 87590)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py	2011-05-28 01:56:23 UTC (rev 87591)
@@ -127,7 +127,8 @@
         buildbot_output = array_stream.ArrayStream()
         printer = printing.Printer(self._port, options, regular_output,
                                    buildbot_output, single_threaded,
-                                   is_fully_parallel)
+                                   is_fully_parallel,
+                                   configure_logging=True)
         return printer, regular_output, buildbot_output
 
     def get_result(self, test, result_type=test_expectations.PASS, run_time=0):

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py (87590 => 87591)


--- trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py	2011-05-28 01:24:21 UTC (rev 87590)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py	2011-05-28 01:56:23 UTC (rev 87591)
@@ -72,7 +72,8 @@
     warnings = _set_up_derived_options(port, options)
 
     printer = printing.Printer(port, options, regular_output, buildbot_output,
-        int(options.child_processes), options.experimental_fully_parallel)
+        int(options.child_processes), options.experimental_fully_parallel,
+        configure_logging=True)
     for w in warnings:
         _log.warning(w)
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to