playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[Bug]: Memory and node threads continue to increase after the test finished

Open minhphong306 opened this issue 1 year ago • 8 comments

Version

1.46.1

Steps to reproduce

  1. Create new folder and init Playwright:
npm init playwright@latest
  1. Open the folder in VSCode, run the example test by clicking the run button.

Expected behavior

After test run, node process stopped.

Actual behavior

node process threads continue to increase and never stop.

image

Additional context

  • I tested on my friends's computer on Windows, and she faced the same problem. When I start debugging, the number of workers continues to increase, never stopping.
  • I tried using terminal to run, and sometimes the node process stopped, sometimes it did not stop.

Environment

System:
    OS: macOS 14.5
    CPU: (8) arm64 Apple M3
    Memory: 57.19 MB / 24.00 GB
  Binaries:
    Node: 20.0.0 - ~/.nvm/versions/node/v20.0.0/bin/node
    npm: 9.6.4 - ~/.nvm/versions/node/v20.0.0/bin/npm
  IDEs:
    VSCode: 1.92.2 - /usr/local/bin/code
  Languages:
    Bash: 3.2.57 - /bin/bash
  npmPackages:
    @playwright/test: ^1.46.1 => 1.46.1

minhphong306 avatar Aug 26 '24 16:08 minhphong306

It's likely something specific to your environment, I was not able to reproduce it neither on Mac nor on Windows. Does it also happen when you run the tests from command line?

yury-s avatar Aug 26 '24 20:08 yury-s

@yury-s I tried with the terminal, but it happened sometimes.

I saw that some of my friends got this issue too.

minhphong306 avatar Aug 27 '24 00:08 minhphong306

Can you update Node to the latest active LTS (v20.17.0) and see if the problem persists? Unfortunately, there is not much we can do without a repro.

yury-s avatar Aug 27 '24 15:08 yury-s

Hi @yury-s, I tried with v20.17.0 and see that the error still happened.

I just init new project without any modification. npm init playwright@latest

minhphong306 avatar Aug 27 '24 16:08 minhphong306

Unable to reproduce as well. As much as we'd like to, we can't do anything about this if we can't repro.

It's interesting to me that your top node process uses 9gb of memory. Could you maybe check what files and ports the process it has opened? (⌘+i -> Open Files and Ports)

Skn0tt avatar Aug 28 '24 06:08 Skn0tt

Hi @Skn0tt, Here is the output: https://gist.github.com/minhphong306/714554a97c38950133afed9b4acd7ccf

image

minhphong306 avatar Aug 28 '24 07:08 minhphong306

Thanks! Can't really spot any smoking gun in there, but it was worth a try. Is there a chance that both you and your friend are using a special kind of antivirus software or anything of the sorts that might be messing up with the processes?

Skn0tt avatar Aug 28 '24 07:08 Skn0tt

I don't think so @Skn0tt. I didn't use any antivirus software. Let me check with my friends and I will update here.

If you have any suggestions, please tell me. Thank you so much.

minhphong306 avatar Aug 28 '24 07:08 minhphong306

Closing because we lack the information and unable to repro. If you figure out something useful, please file a new issue by filling the "Bug Report" template, and link to this one.

dgozman avatar Sep 03 '24 06:09 dgozman

Update: Not sure why, but it seems happened with Node version 20.0.0 You need to remove nodejs completely, restart your computer and install version 22.9.0 or higher.

In case you nvm, please change the default node version and restart VSCode. Hope this helps!

minhphong306 avatar Sep 28 '24 02:09 minhphong306