Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when printing diff of playwright ElementHandle #7009

Closed
6 tasks done
hi-ogawa opened this issue Dec 3, 2024 · 0 comments · Fixed by #7133
Closed
6 tasks done

Crash when printing diff of playwright ElementHandle #7009

hi-ogawa opened this issue Dec 3, 2024 · 0 comments · Fixed by #7133
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@hi-ogawa
Copy link
Contributor

hi-ogawa commented Dec 3, 2024

Describe the bug

(related: #7092)

I had an odd error in Vite playground test https://github.com/vitejs/vite/blob/ccee3d7c7d34fc66854029f27f6cc89de7dcf3c5/playground/html/__tests__/html.spec.ts#L187 and this is probably because of diffing (not sure if chai or pretty-format) failing to handle a large cyclic object.

Minimal repro:

  const browser = await chromium.launch();
  const page = await browser.newPage();
  await page.goto("https://vitest.dev/");
  expect(await page.$("h1")).toBeNull(); // this fails and tries to show diff
 DEV  v2.1.6 /home/hiroshi/code/personal/reproductions/vitest-diff-crash-playwright

 ❯ src/basic.test.ts (1)
   ⠦ basic

<--- Last few GCs --->

[73555:0x26860000]     6761 ms: Scavenge (interleaved) 1278.9 (1325.1) -> 1274.3 (1325.1) MB, pooled: 0 MB, 0.95 / 0.01 ms  (average mu = 0.868, current mu = 0.821) allocation failure; 
[73555:0x26860000]     6789 ms: Mark-Compact 1286.1 (1336.9) -> 240.4 (286.2) MB, pooled: 1050 MB, 12.75 / 0.00 ms  (+ 0.0 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 32 ms) (average mu = 0.972, current mu = 

<--- JS stacktrace --->

FATAL ERROR: invalid table size Allocation failed - JavaScript heap out of memory

Not sure if this is fixable if the object is simply too large, but it's worth investigating this.

Reproduction

https://github.com/hi-ogawa/reproductions/tree/main/vitest-diff-crash-playwright

System Info

System:
    OS: Linux 6.12 Arch Linux
    CPU: (16) x64 12th Gen Intel(R) Core(TM) i7-12650H
    Memory: 18.38 GB / 31.05 GB
    Container: Yes
    Shell: 5.2.37 - /usr/bin/bash
  Binaries:
    Node: 22.11.0 - ~/.volta/tools/image/node/22.11.0/bin/node
    npm: 10.9.0 - ~/.volta/tools/image/node/22.11.0/bin/npm
    pnpm: 10.0.0-beta.1 - ~/.volta/bin/pnpm
    bun: 1.1.29 - ~/.volta/bin/bun
  Browsers:
    Chromium: 131.0.6778.85
  npmPackages:
    vitest: 2.1.6 => 2.1.6

Used Package Manager

pnpm

Validations

@hi-ogawa hi-ogawa changed the title Crash when printing diff of playwright locator Crash when printing diff of playwright ElementHandle Dec 3, 2024
@sheremet-va sheremet-va added p3-minor-bug An edge case that only affects very specific usage (priority) and removed pending triage labels Dec 3, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jan 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants