-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Open
Labels
infrawptrunnerThe automated test runner, commonly called through ./wpt runThe automated test runner, commonly called through ./wpt run
Description
While we configure a mozlog logger, we don't configure any stdlib logger in the subprocess.
See:
wpt/tools/wptrunner/wptrunner/testrunner.py
Lines 197 to 203 in f1c69d8
# Ensure that when we start this in a new process we have the global lock | |
# in the logging module unlocked | |
release_mozlog_lock() | |
proc_name = mpcontext.get_context().current_process().name | |
logger = structuredlog.StructuredLogger(proc_name) | |
logger.add_handler(LogMessageHandler(send_message)) |
Something like this fixes it, but with a notable change:
diff --git a/tools/wptrunner/wptrunner/testrunner.py b/tools/wptrunner/wptrunner/testrunner.py
index cc81b73511..f0fd502e51 100644
--- a/tools/wptrunner/wptrunner/testrunner.py
+++ b/tools/wptrunner/wptrunner/testrunner.py
@@ -10,6 +10,7 @@ from typing import Any, Mapping, Optional
from mozlog import structuredlog, capture
+from . import wptlogging
from . import mpcontext, testloader
# Special value used as a sentinal in various commands
@@ -199,8 +200,13 @@ def start_runner(runner_command_queue, runner_result_queue,
release_mozlog_lock()
proc_name = mpcontext.get_context().current_process().name
- logger = structuredlog.StructuredLogger(proc_name)
+ logger = structuredlog.StructuredLogger("root")
logger.add_handler(LogMessageHandler(send_message))
+ wptlogging.setup_stdlib_logger()
with capture.CaptureIO(logger, capture_stdio):
try:
This clearly changes the name of the logger (though hopefully the pid, etc., are all still correct?); this is needed because the wrapper uses the same name as the underlying stdlib logger:
wpt/tools/third_party_modified/mozlog/mozlog/stdadapter.py
Lines 30 to 32 in f1c69d8
UnstructuredHandler( | |
self.wrapped.name, logging.getLevelName(self.wrapped.level) | |
) |
(I don't know if this is what #10450 was about; it's unclear what that was about, because I believe it's always worked in the main process?)
Metadata
Metadata
Assignees
Labels
infrawptrunnerThe automated test runner, commonly called through ./wpt runThe automated test runner, commonly called through ./wpt run