playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[Bug]: UI Mode Crashes Randomly with Out Of Memory Error

Open ScarletMcLearn opened this issue 5 months ago • 8 comments

Version

1.53.0

Steps to reproduce

  1. Have a Global Setup created to Login
  2. Have a Describe block with Before Each and a Test
  3. In the Before Each run several steps which take around 10 mins
  4. Have a Test in the Describe block to run after Before Each
  5. Run it in UI Mode

Expected behavior

  1. It should run and pass successfully

Actual behavior

  1. UI mode crashes and shows out of memory error after completing before each and during running the test

Additional context

Dev Tools Heap Snapshots : Heap Snapshots

Memory Logs: Memory Logs

Environment

System:
    OS: Windows 11 10.0.26100
    CPU: (32) x64 Intel(R) Core(TM) i9-14900K
    Memory: 74.67 GB / 127.77 GB
  Binaries:
    Node: 20.10.0 - D:\Projects\Tools\Nodist\bin\node.EXE
    npm: 10.2.3 - D:\Projects\Tools\Nodist\bin\npm.EXE
    pnpm: 10.8.1 - D:\Projects\Tools\Nodist\bin\pnpm.CMD
  IDEs:
    VSCode: 1.101.0 - F:\Project_Tools\Microsoft VS Code\bin\code.CMD
  Languages:
    Bash: 5.2.26 - C:\WINDOWS\system32\bash.EXE
  npmPackages:
    @playwright/test: 1.53.0 => 1.53.0
    playwright-ci-reporter: 1.5.3 => 1.5.3
    playwright-html-reporter: 0.1.11 => 0.1.11

ScarletMcLearn avatar Jun 17 '25 12:06 ScarletMcLearn

Thanks for the report! Could you share a minimal reproducible example or more specific steps? The current description is too general for us to reproduce the issue reliably.

mxschmitt avatar Jun 17 '25 12:06 mxschmitt

My pleasure @mxschmitt !

I will try to produce a minimal reproducible example. Currently found it happening in the framework I designed but its not minimal.

Thanks again for the response.

ScarletMcLearn avatar Jun 17 '25 13:06 ScarletMcLearn

Hi.

Here's a repo containing minimal code to reproduce.

It breaks when going from hook to test.

This is the test : test("Should edit the employee using saved ID", async ({ page }) => {

https://ufile.io/cv7hajvq

ScarletMcLearn avatar Jun 17 '25 14:06 ScarletMcLearn

@mxschmitt #33086 Still experience this issue.

FKlindt avatar Jun 18 '25 13:06 FKlindt

Would also like to add - in UI mode - running long tests make PC quite unresponsive / laggy.

Also keeping the Codegen open in Record mode - via page.pause() - for a long time makes system quite laggy / unresponsive as well.

ScarletMcLearn avatar Jun 18 '25 17:06 ScarletMcLearn

I am facing the exact same issue as well

mufradmustavi avatar Jun 19 '25 13:06 mufradmustavi

Crashes when using this as well : npx playwright test --ui --ui-port=8888 --ui-host=127.0.0.1

ScarletMcLearn avatar Jun 19 '25 15:06 ScarletMcLearn

A more detailed memory profile: https://ufile.io/af0viocz

ScarletMcLearn avatar Jun 20 '25 12:06 ScarletMcLearn

same here, randomly consumes all them memory when only running 10 pages, with a max of 100 requests per page.

stevenh avatar Jun 26 '25 20:06 stevenh

There might be a memory leak issue - code gen and ui mode gets quite unresponsive.

ScarletMcLearn avatar Jun 26 '25 22:06 ScarletMcLearn

@ScarletMcLearn at what point specifically are you experiencing the OOM? Simply running your login test over and over does increase memory consumption, but it doesn't crash in any short amount of time on my machine (less than 10 minutes).

A more thorough reproduction would be appreciated.

agg23 avatar Jul 01 '25 19:07 agg23

It usually crashes for long tests which run for 10 mins with a lot of API calls and logs. Did you get a chance to go over the memory profile? It shows a spike in memory usage.

ScarletMcLearn avatar Jul 02 '25 15:07 ScarletMcLearn

After studying a number of traces it's unclear if there's actually a leak here. There's definitely work we can do about loading only subsets of traces to prevent overloading Chrome, but that isn't the same as a leak, and has significantly less urgency for us given this is an unusual scenario.

agg23 avatar Jul 02 '25 15:07 agg23

Closing due to lack of concrete reproduction. Please open a new issue if you are able to reliably and minimally reproduce this issue.

agg23 avatar Jul 14 '25 14:07 agg23