Description
Version
1.52.0
Description
Playwright version 1.52.0 hangs when running tests or stops with out of memory when using --ui
, while 1.51.1 works fine.
Logs without ui(hangs):
2025-04-23T12:13:13.600Z pw:test:task "apply rebaselines" started
2025-04-23T12:13:13.601Z pw:test:task "apply rebaselines" finished
2025-04-23T12:13:13.601Z pw:test:task "clear output" started
2025-04-23T12:13:13.601Z pw:test:task "clear output" finished
2025-04-23T12:13:13.601Z pw:test:task "plugin setup" started
2025-04-23T12:13:13.601Z pw:test:task "plugin setup" finished
2025-04-23T12:13:13.601Z pw:test:task "plugin setup" started
2025-04-23T12:13:13.601Z pw:webserver HTTP GET: http://localhost:3002/
2025-04-23T12:13:13.629Z pw:webserver HTTP Status: 200
2025-04-23T12:13:13.630Z pw:webserver WebServer is already available
2025-04-23T12:13:13.630Z pw:webserver Waiting for availability...
2025-04-23T12:13:13.630Z pw:webserver HTTP GET: http://localhost:3002/
2025-04-23T12:13:13.652Z pw:webserver HTTP Status: 200
2025-04-23T12:13:13.652Z pw:webserver WebServer available
2025-04-23T12:13:13.652Z pw:test:task "plugin setup" finished
2025-04-23T12:13:13.652Z pw:test:task "load tests" started
Logs that I somehow managed to copy before crush with --ui
2025-04-23T11:57:29.866Z pw:channel <EVENT {"guid":"","method":"__create__","params":{"type":"Playwright","initializer":{"chromium":{"guid":"browser-type@09b49a3e6fdee1d1b6b91216493aa6fe"},"firefox":{"guid":"browser-type@5c9f09c2ab5b071fee0fe20ce2b5e76e"},"webkit":{"guid":"browser-type@22ababf057e53151ad9bd0093c8a83ed"},"bidiChromium":{"guid":"browser-type@d6bccb7e0d8b0886b295b9115783d8a6"},"bidiFirefox":{"guid":"browser-type@d7b7f6786cc08f1de50145dd19526984"},"android":{"guid":"android@a6e55338a41dd14317cc897aa6bb8f8c"},"electron":{"guid":"electron@9c496dce35c3bb9a6e77acbb34071dcc"},"utils":{"guid":"localUtils"},"selectors":{"guid":"selectors@1039ec58f01782872305678583be8367"}},"guid":"Playwright"}}
node:buffer:837
return this.utf8Slice(0, this.length);
^
Error: Cannot create a string longer than 0x1fffffe8 characters
at Buffer.toString (node:buffer:837:17)
at PipeTransport._dispatch (/home/xxx/node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/lib/server/pipeTransport.js:67:57)
at Socket.<anonymous> (/home/xxx/node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/lib/server/pipeTransport.js:33:42)
at Socket.emit (node:events:518:28)
at addChunk (node:internal/streams/readable:561:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
at Socket.Readable.push (node:internal/streams/readable:392:5)
at Pipe.onStreamRead (node:internal/stream_base_commons:189:23) {
code: 'ERR_STRING_TOO_LONG'
}
Screenshots(is it supposed to have so many slashes?):
Expected behavior
Tests should run fine.
Actual behavior
Tests hang or crush with out of memory when --ui
used
Additional context
Let me know if I can debug it more precisely.
Environment
System:
OS: Linux 6.11 Ubuntu 24.04.2 LTS 24.04.2 LTS (Noble Numbat)
CPU: (16) x64 AMD Ryzen 7 8845HS w/ Radeon 780M Graphics
Memory: 5.85 GB / 14.87 GB
Container: Yes
Binaries:
Node: 22.14.0 - /usr/bin/node
npm: 10.9.2 - /usr/bin/npm
pnpm: 10.8.0 - ~/snap/code/184/.local/share/pnpm/pnpm
Languages:
Bash: 5.2.21 - /usr/bin/bash
Activity
[-][Bug]: playwrite 1.52.0 hangs on "load tests" started or crush with out of memory[/-][+][Bug]: 1.52.0 hangs on "load tests" started or crush with out of memory[/+]agg23 commentedon Apr 23, 2025
For the main issue, I suggest you look through https://playwright.dev/docs/debug to try to attach a debugger and step through what is happening. That will probably give you a good idea of what is hanging.
The
--ui
crash is due to havingDEBUG
flags set. This is something we should fix.ziimakc commentedon Apr 24, 2025
@agg23 debug is not helpful because it's stuck even before reaching a test :(
Logs while running:
xxx.txt
agg23 commentedon Apr 24, 2025
Ah, I see. Sorry, I missed that the task was named "load tests". Most likely this means that one of your test files is stalling, either in top level code (just sitting in a file) or within a describe. In order to load the tests, all of this code must be executed, so if something takes too long, we can hang. However, I am unsure how this could have regressed.
I recommend filtering the tests you attempt to execute to try to narrow down the test that is causing the issue. If you use the spec path filtering,
npx playwright test some-file.spec.ts
, it should hopefully bypass your issue so you can actually execute.FranciscoKnebel commentedon Apr 30, 2025
Out of memory crashes has been a recurring problem for me for the last couple of months.
I noticed that if running
npx playwright test --ui
while having--ui-port=8080 --ui-host=0.0.0.0
flags set (https://playwright.dev/docs/test-ui-mode#docker--github-codespaces), to open the UI in an external browser, those crashes stopped happening.Hopefully this helps.
agg23 commentedon May 1, 2025
@FranciscoKnebel if you have more information and can come up with a repro, we would appreciate it if you filed a new issue. This issue isn't specifically an OOM issue.
ziimakc commentedon May 1, 2025
Running one test or many doesn't change anything for me
agg23 commentedon May 6, 2025
The OOM crash should now be solved with running UI Mode with
DEBUG
logging. However, that likely doesn't fix your root problem of tests freezing.I still recommend these debugging steps.
ziimakc commentedon May 6, 2025
I've tracked down issue to prisma client import
import { PrismaClient, type Prisma } from "@libs/orm";
which was generated with the following config:Steps to reproduce:
agg23 commentedon May 7, 2025
I am unable to reproduce. I performed the following steps:
Created
schema.prisma
with the following contents:Generated Prisma data:
I edited
tests/example.spec.ts
to contain:This executes and prints the
PrismaClient
object as expected.ziimakc commentedon May 7, 2025
@agg23 here is the reproduction repository, follow readme: https://github.com/ziimakc/playwright-error-reproduction
10 remaining items