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

Cypress crashes after opening a page or in middle of execution #30487

Open
sivaramkumar2908 opened this issue Oct 29, 2024 · 0 comments
Open
Labels
stage: needs investigating Someone from Cypress needs to look at this type: bug

Comments

@sivaramkumar2908
Copy link

sivaramkumar2908 commented Oct 29, 2024

Test code to reproduce

Added my sample flow in here : flow

It has a single spec file where there will be 2 steps login and then opening a particular page with some button click actions.

After opening that page, cypress crashes saying Aw, snap!
Screenshot 2024-10-29 at 8 18 30 PM

Attached memory logs below for reference.

Note: For test development purposes, we are using macOs and for CI/CD actions, we are using ubuntu.
In both those places, we are facing this.

Cypress Mode

cypress run

Cypress Version

13.15.1

Browser Version

Chrome 130.0.6723.70

Node version

23.1.0

Operating System

macOs 12.3/ubuntu

Memory Debug Logs

cypress-verbose:server:browsers:memory start memory profiler +0ms
  cypress:server:browsers:memory using default memory handler +0ms
  cypress:server:browsers:memory skipping garbage collection +2ms
  cypress-verbose:server:browsers:memory memory stats: { checkMemoryPressureDuration: 0.23229193687438965, testTitle: 'Petty Creation', testOrder: 1, garbageCollected: false, timestamp: 1730212650522 } +3ms
  cypress-verbose:server:browsers:memory getJsHeapSizeLimit took 2.805042028427124ms +0ms
  cypress-verbose:server:browsers:memory renderer processes found: { pid: 92434, parentPid: 92408, name: 'Google Chrome Helper (Renderer)', cpu: 11, cpuu: 0, cpus: 0, mem: 1.7, priority: 47, memVsz: 1620209872, memRss: 279232, nice: 0, started: '2024-10-29 20:07:27', state: 'blocked', tty: 'ttys026', user: 'sivaramkumar', command: 'Google Chrome Helper (Renderer)', params: '--type=renderer --string-annotations --noerrdialogs --user-data-dir=/Users/sivaramkumar/Library/Application Support/Cypress/cy/production/browsers/chrome-stable/run-90539 --disable-print-preview --allow-insecure-localhost --autoplay-policy=no-user-gesture-required --disable-background-timer-throttling --disable-breakpad --enable-automation --enable-precise-memory-info --remote-debugging-port=63350 --test-type --use-fake-ui-for-media-stream --lang=en-GB --num-raster-threads=4 --enable-zero-copy --enable-gpu-memory-buffer-compositor-resources --enable-main-frame-before-activation --renderer-client-id=6 --time-ticks-at-unix-epoch=-1729828444854018 --launch-time-ticks=384202877271 --shared-files --field-trial-handle=1718379636,r,158277092352612928,6363489190800710815,262144 --disable-features=PrivacySandboxSettings4,Translate --variations-seed-version --seatbelt-client=63', path: '/Applications/Google Chrome.app/Contents/Frameworks/Google Chrome Framework.framework/Versions/130.0.6723.70/Helpers/Google Chrome Helper (Renderer).app/Contents/MacOS', group: 'browser' } +163ms
  cypress-verbose:server:browsers:memory memory stats: { getAvailableMemoryDuration: 29.887750029563904, getRendererMemoryUsageDuration: 162.5795420408249, jsHeapSizeLimit: 4294705152, totalMemoryLimit: 17179869184, rendererProcessMemRss: 285933568, rendererUsagePercentage: 6.657816028810353, rendererMemoryThreshold: 2147352576, currentAvailableMemory: 14675017728, maxAvailableRendererMemory: 4294705152, shouldCollectGarbage: false, timestamp: 1730212650685, calculateMemoryStatsDuration: 162.80604195594788 } +0ms
  cypress:server:browsers:memory skipping garbage collection +1s
  cypress-verbose:server:browsers:memory memory stats: { checkMemoryPressureDuration: 0.13070905208587646, testTitle: 'Petty Creation', testOrder: 1, garbageCollected: false, timestamp: 1730212651820 } +1s
  cypress-verbose:server:browsers:memory renderer processes found: { pid: 92484, parentPid: 92408, name: 'Google Chrome Helper (Renderer)', cpu: 82.7, cpuu: 0, cpus: 0, mem: 1.4, priority: 47, memVsz: 1620210656, memRss: 242400, nice: 0, started: '2024-10-29 20:07:31', state: 'running', tty: 'ttys026', user: 'sivaramkumar', command: 'Google Chrome Helper (Renderer)', params: '--type=renderer --string-annotations --noerrdialogs --user-data-dir=/Users/sivaramkumar/Library/Application Support/Cypress/cy/production/browsers/chrome-stable/run-90539 --disable-print-preview --allow-insecure-localhost --autoplay-policy=no-user-gesture-required --disable-background-timer-throttling --disable-breakpad --enable-automation --enable-precise-memory-info --remote-debugging-port=63350 --test-type --use-fake-ui-for-media-stream --lang=en-GB --num-raster-threads=4 --enable-zero-copy --enable-gpu-memory-buffer-compositor-resources --enable-main-frame-before-activation --renderer-client-id=8 --time-ticks-at-unix-epoch=-1729828444854018 --launch-time-ticks=384206185018 --shared-files --field-trial-handle=1718379636,r,158277092352612928,6363489190800710815,262144 --disable-features=PrivacySandboxSettings4,Translate --variations-seed-version --seatbelt-client=121', path: '/Applications/Google Chrome.app/Contents/Frameworks/Google Chrome Framework.framework/Versions/130.0.6723.70/Helpers/Google Chrome Helper (Renderer).app/Contents/MacOS', group: 'browser' } +25ms
  cypress-verbose:server:browsers:memory memory stats: { getAvailableMemoryDuration: 18.73033308982849, getRendererMemoryUsageDuration: 153.87583303451538, jsHeapSizeLimit: 4294705152, totalMemoryLimit: 17179869184, rendererProcessMemRss: 248217600, rendererUsagePercentage: 5.77961911737777, rendererMemoryThreshold: 2147352576, currentAvailableMemory: 14232731648, maxAvailableRendererMemory: 4294705152, shouldCollectGarbage: false, timestamp: 1730212651845, calculateMemoryStatsDuration: 153.92375004291534 } +0ms
  cypress-verbose:server:browsers:memory memory stats: { getRendererMemoryUsageDuration: 6.898999929428101, getAvailableMemoryDuration: 14.471875071525574, jsHeapSizeLimit: 4294705152, totalMemoryLimit: 17179869184, rendererProcessMemRss: 290455552, rendererUsagePercentage: 6.76310809985961, rendererMemoryThreshold: 2147352576, currentAvailableMemory: 14225965056, maxAvailableRendererMemory: 4294705152, shouldCollectGarbage: false, timestamp: 1730212652859, calculateMemoryStatsDuration: 14.507333040237427 } +1s
  cypress-verbose:server:browsers:memory memory stats: { getRendererMemoryUsageDuration: 5.600458025932312, getAvailableMemoryDuration: 14.852958083152771, jsHeapSizeLimit: 4294705152, totalMemoryLimit: 17179869184, rendererProcessMemRss: 300318720, rendererUsagePercentage: 6.99276689251053, rendererMemoryThreshold: 2147352576, currentAvailableMemory: 14221443072, maxAvailableRendererMemory: 4294705152, shouldCollectGarbage: false, timestamp: 1730212653874, calculateMemoryStatsDuration: 14.879541993141174 } +1s
  cypress-verbose:server:browsers:memory memory stats: { getRendererMemoryUsageDuration: 4.934208035469055, getAvailableMemoryDuration: 13.149041891098022, jsHeapSizeLimit: 4294705152, totalMemoryLimit: 17179869184, rendererProcessMemRss: 344326144, rendererUsagePercentage: 8.01745712018556, rendererMemoryThreshold: 2147352576, currentAvailableMemory: 14252605440, maxAvailableRendererMemory: 4294705152, shouldCollectGarbage: false, timestamp: 1730212654889, calculateMemoryStatsDuration: 13.17504096031189 } +1s
  cypress-verbose:server:browsers:memory memory stats: { getRendererMemoryUsageDuration: 15.357084035873413, getAvailableMemoryDuration: 32.00116693973541, jsHeapSizeLimit: 4294705152, totalMemoryLimit: 17179869184, rendererProcessMemRss: 357875712, rendererUsagePercentage: 8.332951840322284, rendererMemoryThreshold: 2147352576, currentAvailableMemory: 14281719808, maxAvailableRendererMemory: 4294705152, shouldCollectGarbage: false, timestamp: 1730212655923, calculateMemoryStatsDuration: 32.04191601276398 } +1s
  cypress-verbose:server:browsers:memory memory stats: { getRendererMemoryUsageDuration: 7.18179190158844, getAvailableMemoryDuration: 16.055583000183105, jsHeapSizeLimit: 4294705152, totalMemoryLimit: 17179869184, rendererProcessMemRss: 363757568, rendererUsagePercentage: 8.46990783128853, rendererMemoryThreshold: 2147352576, currentAvailableMemory: 14260682752, maxAvailableRendererMemory: 4294705152, shouldCollectGarbage: false, timestamp: 1730212656942, calculateMemoryStatsDuration: 16.092417001724243 } +1s
  cypress-verbose:server:browsers:memory memory stats: { getRendererMemoryUsageDuration: 5.894707918167114, getAvailableMemoryDuration: 13.695500016212463, jsHeapSizeLimit: 4294705152, totalMemoryLimit: 17179869184, rendererProcessMemRss: 382713856, rendererUsagePercentage: 8.911295245071111, rendererMemoryThreshold: 2147352576, currentAvailableMemory: 14253555712, maxAvailableRendererMemory: 4294705152, shouldCollectGarbage: false, timestamp: 1730212657958, calculateMemoryStatsDuration: 13.737167000770569 } +1s
  cypress-verbose:server:browsers:memory memory stats: { getRendererMemoryUsageDuration: 6.102292060852051, getAvailableMemoryDuration: 13.84679102897644, jsHeapSizeLimit: 4294705152, totalMemoryLimit: 17179869184, rendererProcessMemRss: 391266304, rendererUsagePercentage: 9.110434596838186, rendererMemoryThreshold: 2147352576, currentAvailableMemory: 14267236352, maxAvailableRendererMemory: 4294705152, shouldCollectGarbage: false, timestamp: 1730212658974, calculateMemoryStatsDuration: 13.877500057220459 } +1s
  cypress-verbose:server:browsers:memory memory stats: { getRendererMemoryUsageDuration: 6.181708931922913, getAvailableMemoryDuration: 45.33633291721344, jsHeapSizeLimit: 4294705152, totalMemoryLimit: 17179869184, rendererProcessMemRss: 397492224, rendererUsagePercentage: 9.255401941036439, rendererMemoryThreshold: 2147352576, currentAvailableMemory: 14264827904, maxAvailableRendererMemory: 4294705152, shouldCollectGarbage: false, timestamp: 1730212660020, calculateMemoryStatsDuration: 45.38454210758209 } +1s
  cypress-verbose:server:browsers:memory memory stats: { getRendererMemoryUsageDuration: 5.682250022888184, getAvailableMemoryDuration: 12.504541993141174, jsHeapSizeLimit: 4294705152, totalMemoryLimit: 17179869184, rendererProcessMemRss: 399998976, rendererUsagePercentage: 9.31377037172679, rendererMemoryThreshold: 2147352576, currentAvailableMemory: 14238138368, maxAvailableRendererMemory: 4294705152, shouldCollectGarbage: false, timestamp: 1730212661038, calculateMemoryStatsDuration: 12.518041014671326 } +1s
  cypress-verbose:server:browsers:memory end memory profiler +76ms

We detected that the Chrome Renderer process just crashed.

We have failed the current spec but will continue running the next spec.

This can happen for a number of different reasons.

If you're running lots of tests on a memory intense application.
  - Try increasing the CPU/memory on the machine you're running on.
  - Try enabling experimentalMemoryManagement in your config file.
  - Try lowering numTestsKeptInMemory in your config file during 'cypress open'.

You can learn more here:

https://on.cypress.io/renderer-process-crashed

Other

Crash on this mentioned page opening, seems very unavoidable. So added that flow in my project.

There are few other scenarios, we are facing this issue.

We have quite a large e2e business flows involving multiple actions. To cover that we created long running suites, we were facing this issue quite frequently. To avoid this, we split a single suite(execution time: ~60-90 mins) to n number of suites with each having reduced running time(~20-30mins). This solved to some extent. Even after splitting this much, we were facing memory issue in few scenarios.

@jennifer-shehane jennifer-shehane added type: bug stage: needs investigating Someone from Cypress needs to look at this labels Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: needs investigating Someone from Cypress needs to look at this type: bug
Projects
None yet
Development

No branches or pull requests

2 participants