mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00

A summary about the attempts we tried in https://github.com/microsoft/playwright/pull/26931 for https://github.com/microsoft/playwright/issues/26859 and https://github.com/microsoft/playwright/issues/24591. 1. attempt: collect all the stdio from the worker host. - this made it hard to capture the live console logs for the live trace 2. attempt: collect all the stdio from the worker host, but keep proxying `process.{stdout,stderr}.write`. - this solved the live console logs problem, since we could still listen on them - we found out about a race that the stdout/stderr streams can still buffer data while the test already had finished - we created a best effort flush implementation but didn't like the complexity it introduced to the project 3. attempt: keep things like they are but also listen to stdio from the worker host - this solves the race of console.log in the test (things stay like they are) - this keeps live trace working (things stay like they are) - a known pitfall is that it could result in logs which don't end up in the reporter onStdOut/onStdErr, but it is already a significant improvement over how it was before. - before: they were not getting displayed - after: they are getting displayed and there is a low likelihood that they don't end up in the reporter API if the write happens slightly before a test finished. Closes #26931 Fixes #26859 Fixes #24591