Skip to content

Commit

Permalink
Reland "[wptrunner] Log which browser (PID) ran each test (#45472)"
Browse files Browse the repository at this point in the history
This is an identical reland of #44716; #44736 fixed the underlying regression.
---

`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 authored Apr 2, 2024
1 parent e02118b commit 7b53a7e
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 7b53a7e

Please sign in to comment.