Bug 1421799 - [reftest] Log 'GECKO(<pid>)' instead of 'ProcessReader' for process_output log actions r=gbrown
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Wed, 06 Dec 2017 14:11:55 -0500
changeset 449438 419ba12cc0c838d661b8ae6d47bbf328242773fc
parent 449437 5ee21ac1a6ecf2a838acb2e05a47af5d9bd84aa9
child 449439 0ad440c6f93bb793761794d277d20f4fa8c7fd02
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgbrown
bugs1421799
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1421799 - [reftest] Log 'GECKO(<pid>)' instead of 'ProcessReader' for process_output log actions r=gbrown MozReview-Commit-ID: FsKg5Gtwx9Z
layout/tools/reftest/output.py
layout/tools/reftest/runreftest.py
--- a/layout/tools/reftest/output.py
+++ b/layout/tools/reftest/output.py
@@ -123,16 +123,17 @@ class OutputHandler(object):
     """Process the output of a process during a test run and translate
     raw data logged from reftest.js to an appropriate structured log action,
     where applicable.
     """
 
     def __init__(self, log, utilityPath, symbolsPath=None):
         self.stack_fixer_function = get_stack_fixer_function(utilityPath, symbolsPath)
         self.log = log
+        self.proc_name = None
 
     def __call__(self, line):
         # need to return processed messages to appease remoteautomation.py
         if not line.strip():
             return []
         line = line.decode('utf-8', errors='replace')
 
         try:
@@ -146,9 +147,10 @@ class OutputHandler(object):
         else:
             self.verbatim(json.dumps(data))
 
         return [data]
 
     def verbatim(self, line):
         if self.stack_fixer_function:
             line = self.stack_fixer_function(line)
-        self.log.process_output(threading.current_thread().name, line)
+        name = self.proc_name or threading.current_thread().name
+        self.log.process_output(name, line)
--- a/layout/tools/reftest/runreftest.py
+++ b/layout/tools/reftest/runreftest.py
@@ -708,16 +708,17 @@ class RefTest(object):
                             process_class=mozprocess.ProcessHandlerMixin,
                             cmdargs=cmdargs,
                             env=env,
                             process_args=kp_kwargs)
         runner.start(debug_args=debug_args,
                      interactive=interactive,
                      outputTimeout=timeout)
         proc = runner.process_handler
+        outputHandler.proc_name = 'GECKO({})'.format(proc.pid)
 
         # Used to defer a possible IOError exception from Marionette
         marionette_exception = None
 
         if self.use_marionette:
             marionette_args = {
                 'socket_timeout': options.marionette_socket_timeout,
                 'startup_timeout': options.marionette_startup_timeout,
@@ -744,16 +745,17 @@ class RefTest(object):
                 # wrong with the process, like a crash or the socket is no
                 # longer open. We defer raising this specific error so that
                 # post-test checks for leaks and crashes are performed and
                 # reported first.
                 marionette_exception = sys.exc_info()
 
         status = runner.wait()
         runner.process_handler = None
+        outputHandler.proc_name = None
 
         if status:
             msg = "TEST-UNEXPECTED-FAIL | %s | application terminated with exit code %s" % \
                 (self.lastTestSeen, status)
             # use process_output so message is logged verbatim
             self.log.process_output(None, msg)
         else:
             self.lastTestSeen = self.TEST_SEEN_FINAL