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:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@87591
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-05-27 Dirk Pranke <dpranke@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 <aroben@apple.com>
Always decode tester names from location.hash
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()
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
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
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)
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):
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)