Describe the bug
While waiting for expect.element to resolve, prettyDOM will be called on every attempt and its going to send the whole body as dom parameter. This makes memory usage go wild and at some point it goes OOM. Can confirm removing prettyDom usage in following line fixes the issue:
|
const error = new Error(`Cannot find element with locator: ${asLocator('javascript', selector)}\n\n${prettyDOM(container)}`) |
IDK how Im the first person to notice this bug... I wonder if Im missing a config param or something.
Reproduction
Had to reproduce it on private codebase so I cant really share code here.
After removing the prettyDOM call, all tests pass successfully:
System Info
System:
OS: macOS 15.1.1
CPU: (14) arm64 Apple M3 Max
Memory: 8.26 GB / 36.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node
Yarn: 4.5.1 - ~/.nvm/versions/node/v20.12.2/bin/yarn
npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm
Browsers:
Chrome: 131.0.6778.205
Safari: 18.1.1
Used Package Manager
yarn
Validations
Describe the bug
While waiting for expect.element to resolve, prettyDOM will be called on every attempt and its going to send the whole body as
domparameter. This makes memory usage go wild and at some point it goes OOM. Can confirm removingprettyDomusage in following line fixes the issue:vitest/packages/browser/src/client/tester/public-utils.ts
Line 69 in f4406f1
IDK how Im the first person to notice this bug... I wonder if Im missing a config param or something.
Reproduction
Had to reproduce it on private codebase so I cant really share code here.
After removing the
prettyDOMcall, all tests pass successfully:System Info
System: OS: macOS 15.1.1 CPU: (14) arm64 Apple M3 Max Memory: 8.26 GB / 36.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node Yarn: 4.5.1 - ~/.nvm/versions/node/v20.12.2/bin/yarn npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm Browsers: Chrome: 131.0.6778.205 Safari: 18.1.1Used Package Manager
yarn
Validations