Skip to content

feat(list reporter): add printWorkerIndex option to prefix output with worker index - #42886

Merged
Pavel Feldman (pavelfeldman) merged 1 commit into
microsoft:mainfrom
pavelfeldman:list-worker-index
Sep 23, 2026
Merged

Pavel Feldman (pavelfeldman) merged 1 commit into
microsoft:mainfrom
pavelfeldman:list-worker-index

Conversation

@pavelfeldman

@pavelfeldman Pavel Feldman (pavelfeldman) commented Sep 23, 2026

Copy link
Copy Markdown
Member

Summary

  • New list reporter option printWorkerIndex (env PLAYWRIGHT_LIST_PRINT_WORKER_INDEX) prefixes every test line, stdio line and inline failure with the index of the worker that produced it.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@yury-s Yury Semikhatsky (yury-s) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be printPid as discussed ?

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

8 flaky ⚠️ [chromium-library] › library/chromium/chromium.spec.ts:179 › serviceWorker(), and fromServiceWorker() work `@frozen-time-library-chromium-linux`
⚠️ [chromium-library] › library/video.spec.ts:690 › screencast › should capture full viewport `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/popup.spec.ts:260 › should not throw when click closes popup `@chromium-ubuntu-22.04-node20`
⚠️ [chromium-library] › library/beforeunload.spec.ts:130 › should support dismissing the dialog multiple times `@chromium-ubuntu-22.04-node22`
⚠️ [chromium-library] › library/video.spec.ts:762 › screencast › should work with video+trace `@chromium-ubuntu-22.04-node22`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:257 › third party 'Partitioned;' cookies `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:470 › top level 'Partitioned;' cookie and same origin iframe `@firefox-ubuntu-22.04-node20`
⚠️ [playwright-test] › ui-mode-trace.spec.ts:388 › should reveal errors in the sourcetab `@windows-latest-node22`

52140 passed, 1241 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

2 failed
❌ [chromium] › mcp/cli-webmcp.spec.ts:162 › webmcp-call disambiguates duplicate tool names by frame @mcp-macos-latest-chromium
❌ [firefox] › mcp/cli-core.spec.ts:43 › click button @mcp-windows-latest-firefox

8703 passed, 1474 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

🟢 CI is clear — both failures are known flakes

Hi, I'm the Playwright bot and I took a look at the failing CI.

The two MCP failures, mcp/cli-webmcp.spec.ts:162 and mcp/cli-core.spec.ts:43, both flip verdict across runs on SHAs and main-branch pushes that have nothing to do with this PR. This PR only touches the list reporter, which neither test goes near.

Details

Overall: the latest reports are 2 failed in MCP and 8 flaky (all rescued on retry) in tests 1. Nothing here is attributable to the printWorkerIndex change — the diff is confined to packages/playwright/src/reporters/list.ts, its type declarations, docs, and tests/playwright-test/reporter-list.spec.ts. The MCP suite runs the CLI with its own reporter setup and doesn't exercise the list reporter's worker-index prefixing.

Pre-existing flake / infra

Triaged by the Playwright bot - agent run

console.log('line1\\nline2');
});
`,
}, { workers: 1 }, { PW_TEST_DEBUG_REPORTERS: '1', PLAYWRIGHT_FORCE_TTY: '80' });

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run with 2 workers?

if (!this._printWorkerIndex)
return '';
const workerIndex = result.workerIndex >= 0 ? String(result.workerIndex) : ' ';
return this.screen.colors.dim(`[${workerIndex}]`) + ' ';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add some padding?

@pavelfeldman
Pavel Feldman (pavelfeldman) merged commit 91eeb0c into microsoft:main Sep 23, 2026
43 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants