Skip to content

fix(ct): Don't bloat metainfo.json file when # or ? is present in id#39074

Open
mikstime wants to merge 1 commit intomicrosoft:mainfrom
mikstime:patch-1
Open

fix(ct): Don't bloat metainfo.json file when # or ? is present in id#39074
mikstime wants to merge 1 commit intomicrosoft:mainfrom
mikstime:patch-1

Conversation

@mikstime
Copy link

@mikstime mikstime commented Feb 1, 2026

Proposal

Remove the ? or # part from dependencies in the metainfo.json file.

Description

@playwright/experimental-ct-core generates a metainfo.json file used for caching and other optimizations performed by Playwright under the hood.

The current implementation relies on a Vite plugin to generate this file. However, Vite prohibits the usage of # and ? in file names, meaning there is no reason to store them in the metainfo.json file.

Both # and ? are reserved for compatibility with browser URLs.

-- patak-dev

We experienced two major issues with the current behavior:

  • Our metainfo.json file exceeded 512MB, which is the hard limit for the JSON.parse() method, resulting in unexpected crashes

  • This data was serialized and deserialized each time tests ran, resulting in a 4x slowdown of tests in our project

80% performance improvement with proposed fix

Example

Metainfo.json file is reduced from 1.4M to 4.0K in provided example

1.4M    current/playwright/.cache/metainfo.json
4.0K    patched/playwright/.cache/metainfo.json

https://github.com/mikstime/playwright

@dgozman
Copy link
Contributor

dgozman commented Feb 3, 2026

@mikstime Thank you for the PR! Is there any way you can share a repro, or even better - turn that into a test? That would help us to review and prevent future regressions.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

Test results for "tests 1"

6 failed
❌ [firefox-library] › library/browsercontext-events.spec.ts:103 › dialog event should work in popup @firefox-ubuntu-22.04-node20
❌ [firefox-library] › library/browsercontext-events.spec.ts:135 › dialog event should work in immediately closed popup @firefox-ubuntu-22.04-node20
❌ [firefox-page] › page/page-event-popup.spec.ts:61 › should be able to capture alert @firefox-ubuntu-22.04-node20
❌ [playwright-test] › reporter-html.spec.ts:1078 › merged › should use file-browser friendly extensions for buffer attachments based on contentType @macos-latest-node20
❌ [playwright-test] › ui-mode-test-network-tab.spec.ts:146 › should format JSON request body @windows-latest-node20
❌ [playwright-test] › ui-mode-test-network-tab.spec.ts:301 › should copy network request @windows-latest-node20

4 flaky ⚠️ [chromium-library] › library/inspector/cli-codegen-3.spec.ts:226 › cli codegen › should generate frame locators (4) `@chromium-ubuntu-22.04-node24`
⚠️ [firefox-library] › library/beforeunload.spec.ts:188 › does not get stalled by beforeUnload `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:1082 › cli codegen › should not throw csp directive violation errors `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-page] › page/page-wait-for-function.spec.ts:104 › should work with strict CSP policy `@firefox-ubuntu-22.04-node20`

34255 passed, 662 skipped


Merge workflow run.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

Test results for "MCP"

4 failed
❌ [chrome] › mcp/cli-save-as.spec.ts:20 › screenshot @mcp-macos-15
❌ [chrome] › mcp/cli-session.spec.ts:92 › session-delete non-existent session @mcp-macos-15
❌ [chrome] › mcp/launch.spec.ts:21 › test reopen browser @mcp-macos-15
❌ [firefox] › mcp/cli-session.spec.ts:68 › session-delete @mcp-macos-15

3816 passed, 145 skipped


Merge workflow run.

@mikstime
Copy link
Author

mikstime commented Feb 3, 2026

@mikstime Thank you for the PR! Is there any way you can share a repro, or even better - turn that into a test? That would help us to review and prevent future regressions.

Here is an example https://github.com/mikstime/playwright

@dgozman
Copy link
Contributor

dgozman commented Feb 4, 2026

@mikstime Thank you for the PR! Is there any way you can share a repro, or even better - turn that into a test? That would help us to review and prevent future regressions.

Here is an example https://github.com/mikstime/playwright

Wonderful! Could you please add a test to tests/playwright-test/playwright.ct-build.spec.ts that follows this example? You can run it with npm run ttest playwright.ct-build.spec:<line>.

@mikstime
Copy link
Author

mikstime commented Feb 4, 2026

@microsoft-github-policy-service agree

@mikstime
Copy link
Author

mikstime commented Feb 4, 2026

@mikstime Thank you for the PR! Is there any way you can share a repro, or even better - turn that into a test? That would help us to review and prevent future regressions.

Here is an example https://github.com/mikstime/playwright

Wonderful! Could you please add a test to tests/playwright-test/playwright.ct-build.spec.ts that follows this example? You can run it with npm run ttest playwright.ct-build.spec:<line>.

Sure. Thank you for the instructions.

Running 1 test using 1 worker

  ✓  1 [playwright-test] › tests/playwright-test/playwright.ct-build.spec.ts:740:5 › should remove ? or # from deps in metainfo.json (3.1s)

  1 passed (3.8s)

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