Skip to content

Commit

Permalink
[wptrunner] Log which browser (PID) ran each test (web-platform-tests…
Browse files Browse the repository at this point in the history
…#44716)

`mozlog` allows `process_output` events to be interspersed between any
`test_*` events [0]. When running tests in parallel, there's currently
no structured way to tell which test a `process_event` corresponds to,
which prevents us from extracting per-test browser logs. (The required
`pid` field is unhelpfully that of the main `testrunner` process.)

Log the browser PID during `test_end` as `extra.browser_pid` so that it
can be joined against `process_output`'s `process` field.

[0]: https://firefox-source-docs.mozilla.org/mozbase/mozlog.html#testsuite-protocol
  • Loading branch information
jonathan-j-lee committed Feb 22, 2024
1 parent 2602e04 commit eb8b11e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/wptrunner/wptrunner/testrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,8 @@ def test_ended(self, test, results):
test.max_assertion_count)

file_result.extra["test_timeout"] = test.timeout * self.executor_kwargs['timeout_multiplier']
if self.browser.browser_pid:
file_result.extra["browser_pid"] = self.browser.browser_pid

self.logger.test_end(test.id,
status,
Expand Down

0 comments on commit eb8b11e

Please sign in to comment.