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 randomly crashes in chrome when using Cypress Open with 'Aw, Snap!' #29895

Closed
dqiubread opened this issue Jul 19, 2024 · 8 comments
Closed
Labels

Comments

@dqiubread
Copy link

dqiubread commented Jul 19, 2024

Test code to reproduce

Unfortunately i dont have a way to create a failing test. I do have the failure logs though. We are using experimentalMemoryManagement and numTestsKeptInMemory when using cypress open but its not working.
image

Cypress Mode

cypress open

Cypress Version

13.13.1

Browser Version

126

Node version

v19.1.0

Operating System

macos ventures 13.6.4

Memory Debug Logs

 cypress-verbose:server:browsers:memory memory stats: { getAvailableMemoryDuration: 91.65353200212121, getRendererMemoryUsageDuration: 552.6555650010705, jsHeapSizeLimit: 4294705152, totalMemoryLimit: 34359738368, rendererProcessMemRss: 435789824, rendererUsagePercentage: 10.147141854361228, rendererMemoryThreshold: 2147352576, currentAvailableMemory: 23630331904, maxAvailableRendererMemory: 4294705152, shouldCollectGarbage: false, timestamp: 1721424365660, calculateMemoryStatsDuration: 553.1010669991374 } +1ms
GET /v1/pages/ChVDaHJvbWUvMTI2LjAuNjQ3OC4xODMSIAkj7o6dJktMPBIFDTec3tMSBQ2RYZVOIbnR8tuRAveJ?alt=proto 200 2055.933 ms - -
  cypress-verbose:server:browsers:memory memory stats: { getRendererMemoryUsageDuration: 30.03667100146413, getAvailableMemoryDuration: 72.0677389986813, jsHeapSizeLimit: 4294705152, totalMemoryLimit: 34359738368, rendererProcessMemRss: 439590912, rendererUsagePercentage: 10.235648232924373, rendererMemoryThreshold: 2147352576, currentAvailableMemory: 23636283392, maxAvailableRendererMemory: 4294705152, shouldCollectGarbage: false, timestamp: 1721424366732, calculateMemoryStatsDuration: 72.10428100079298 } +1s
  cypress-verbose:server:browsers:memory memory stats: { getRendererMemoryUsageDuration: 30.33804599940777, getAvailableMemoryDuration: 80.23153300210834, jsHeapSizeLimit: 4294705152, totalMemoryLimit: 34359738368, rendererProcessMemRss: 439959552, rendererUsagePercentage: 10.244231825672953, rendererMemoryThreshold: 2147352576, currentAvailableMemory: 23630811136, maxAvailableRendererMemory: 4294705152, shouldCollectGarbage: false, timestamp: 1721424367813, calculateMemoryStatsDuration: 80.28332900255919 } +1s
cypress-verbose:server:browsers:memory memory stats: { getRendererMemoryUsageDuration: 43.475676998496056, getAvailableMemoryDuration: 90.7930269986391, jsHeapSizeLimit: 4294705152, totalMemoryLimit: 34359738368, rendererProcessMemRss: 448569344, rendererUsagePercentage: 10.444706402978698, rendererMemoryThreshold: 2147352576, currentAvailableMemory: 23648473088, maxAvailableRendererMemory: 4294705152, shouldCollectGarbage: false, timestamp: 1721424368904, calculateMemoryStatsDuration: 90.83297200128436 } +1s
cypress-verbose:server:browsers:memory end memory profiler +656ms
cypress:server:remote-states getting remote state: { auth: null, origin: '<removed>', strategy: 'http', fileServer: null, domainName: '<removed>', props: { port: '443', protocol: 'https:', subdomain: '<removed>', domain: '<removed>', tld: 'net' } } for: https://<removed>.net +1ms
POST /api/v2/rum? -
GET /public/25TDVT6K.png 200 125.015 ms - -
cypress:server:request aborting { requestId: 'request53' } +246ms
GET /eval/605b999406d2ef0d625c3747/eyJhbm9ueW1vdXMiOnRydWUsImtleSI6IjkyNGRlOWIwLTQ2MTItMTFlZi04MzgyLWRiY2Q1NDEzOGUzMSJ9 200 207.701 ms - -
  cypress:server:request aborting { requestId: 'request53' } +1ms
  cypress:server:util:socket_allowed allowed socket closed, removing { localPort: 59718 } +592ms
  cypress:server:request received an error on request after response started { browserPreRequest: { requestId: '87012.169', method: 'GET', url: 'https://clientstream.launchdarkly.com/eval/605b999406d2ef0d625c3747/eyJhbm9ueW1vdXMiOnRydWUsImtleSI6IjkyNGRlOWIwLTQ2MTItMTFlZi04MzgyLWRiY2Q1NDEzOGUzMSJ9', headers: { 'sec-ch-ua': '"Not/A)Brand";v="8", "Chromium";v="126", "Google Chrome";v="126"', Accept: 'text/event-stream', 'Cache-Control': 'no-cache', Referer: 'https://url.com/', 'sec-ch-ua-mobile': '?0', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36', 'sec-ch-ua-platform': '"macOS"' }, resourceType: 'other', originalResourceType: 'EventSource', initiator: { type: 'other' }, documentURL: 'https://<removed>/login', hasRedirectResponse: false, cdpRequestWillBeSentTimestamp: 1721423105319.58, cdpRequestWillBeSentReceivedTimestamp: 1721423105321.3723, proxyRequestReceivedTimestamp: 1721423105330.8335, cdpLagDuration: 1.792236328125, proxyRequestCorrelationDuration: 0 }, timeout: undefined, retryIntervals: [], url: 'https://clientstream.launchdarkly.com/eval/605b999406d2ef0d625c3747/eyJhbm9ueW1vdXMiOnRydWUsImtleSI6IjkyNGRlOWIwLTQ2MTItMTFlZi04MzgyLWRiY2Q1NDEzOGUzMSJ9', time: false, requestId: 'request53', retryOnNetworkFailure: true, retryOnStatusCodeFailure: false, delaysRemaining: [], err: Error: aborted     at connResetException (node:internal/errors:720:14)     at TLSSocket.socketCloseListener (node:_http_client:461:19)     at TLSSocket.emit (node:events:526:35)     at node:net:323:12     at TCP.done (node:_tls_wrap:588:7) { code: 'ECONNRESET' } } +1ms
  cypress:server:util:socket_allowed allowed socket closed, removing { localPort: 59898 } +2ms
  cypress:server:browsers:cri-client crash detected +6s
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

No response

@dqiubread dqiubread changed the title Cypress randomly crashes in chrome test Cypress randomly crashes in chrome when using Cypress Open Jul 19, 2024
@MikeMcC399
Copy link
Contributor

@dqiubread

You should probably update your Node.js version before continuing with your troubleshooting, since Node.js v19.1.0 entered end-of-life about one year ago. Node.js 20.x LTS is often a good choice.

@jennifer-shehane jennifer-shehane changed the title Cypress randomly crashes in chrome when using Cypress Open Cypress randomly crashes in chrome when using Cypress Open with 'Aw, Snap!' Jul 30, 2024
@jennifer-shehane jennifer-shehane added type: performance 🏃‍♀️ Performance related stage: needs information Not enough info to reproduce the issue labels Jul 30, 2024
@dqiubread
Copy link
Author

dqiubread commented Aug 2, 2024

@dqiubread

You should probably update your Node.js version before continuing with your troubleshooting, since Node.js v19.1.0 entered end-of-life about one year ago. Node.js 20.x LTS is often a good choice.

I updated node to a new version and it seems to still be an issue intermittently. One thing that I am doing is I am trying to type into an input field by skipping the delay and it seems its when it types into the input field that it crashes.

const jwt = "ZXlKMGVYQWlPaUpLVjFRaUxDSmhiR2NpT2lKSVV6STFOaUo5LmV5SnBjM01pT2lKUGJteHBibVVnU2xkVUlFSjFhV3hrWlhJaUxDSnBZWFFpT2pFM01qSTJNRFl3T1Rrc0ltVjRjQ0k2TVRjMU5ERTBNakE1T1N3aVlYVmtJam9pZDNkM0xtVjRZVzF3YkdVdVkyOXRJaXdpYzNWaUlqb2lhbkp2WTJ0bGRFQmxlR0Z0Y0d4bExtTnZiU0lzSWtkcGRtVnVUbUZ0WlNJNklrcHZhRzV1ZVNJc0lsTjFjbTVoYldVaU9pSlNiMk5yWlhRaUxDSkZiV0ZwYkNJNld5SnFjbTlqYTJWMFFHVjRZVzF3YkdVdVkyOXRJaXdpWW1WbFFHVjRZVzF3YkdVdVkyOXRJaXdpWW1WbFFHVjRZVzF3YkdVdVkyOXRJaXdpWW1WbFFHVjRZVzF3YkdVdVkyOXRJaXdpWW1WbFFHVjRZVzF3YkdVdVkyOXRJaXdpWW1WbFFHVjRZVzF3YkdVdVkyOXRJaXdpWW1WbFFHVjRZVzF3YkdVdVkyOXRJaXdpWW1WbFFHVjRZVzF3YkdVdVkyOXRJaXdpWW1WbFFHVjRZVzF3Y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V29xNVNDSFdpbE8wdjdXVlowdkt0TWVJQjhTX09RYzFmOFloMDFraW8=";
      cy.visit("https://test.com");
      cy.get('[class*="searchBox"] button').click();
      cy.get('[id="docsearch-input"]').clear();
      cy.get('[id="docsearch-input"]').invoke("val", jwt).trigger("change");
      cy.get('[id="docsearch-input"]').type(" {backspace}");

@jennifer-shehane
Copy link
Member

@dqiubread I'm able to run a sample of this test on a simple HTML page with an input and this does not recreate.

Does your App function fine when you manually perform these actions outside of Cypress? Invoking the val? Just want to isolate a memory leak from your actual application code.

@dqiubread
Copy link
Author

dqiubread commented Aug 2, 2024

@dqiubread I'm able to run a sample of this test on a simple HTML page with an input and this does not recreate.

Does your App function fine when you manually perform these actions outside of Cypress? Invoking the val? Just want to isolate a memory leak from your actual application code.

Ya it works fine when im manually doing it on our webpage. It only seems to happen when we run the test with the open command and works fine when we run on our CI/CD instance.

@dqiubread
Copy link
Author

here is one of the latest run logs that crashed.

 cypress-verbose:server:browsers:memory memory stats: { getRendererMemoryUsageDuration: 89.7462279945612, getAvailableMemoryDuration: 141.33290600031614, jsHeapSizeLimit: 4294705152, totalMemoryLimit: 34359738368, rendererProcessMemRss: 503291904, rendererUsagePercentage: 11.718893059879143, rendererMemoryThreshold: 2147352576, currentAvailableMemory: 22848724992, maxAvailableRendererMemory: 4294705152, shouldCollectGarbage: false, timestamp: 1722983996821, calculateMemoryStatsDuration: 141.38143600523472 } +1s
 cypress-verbose:server:browsers:memory end memory profiler +640ms
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

@dqiubread
Copy link
Author

@dqiubread I'm able to run a sample of this test on a simple HTML page with an input and this does not recreate.

Does your App function fine when you manually perform these actions outside of Cypress? Invoking the val? Just want to isolate a memory leak from your actual application code.

@jennifer-shehane is there a different command that i can run that would be able to help get to the root of this performance issue?

@jennifer-shehane
Copy link
Member

@dqiubread Providing a reproduction that we can run - and track down the issue would be ideal. The logs would just show that there is a perf issue, which we believe, but it won't give us much information about why without recreating it ourselves and running through our code paths.

@dqiubread
Copy link
Author

dqiubread commented Aug 9, 2024

We figured out the issue was with the UI. When we do the invoke to set the text we dont need to do the trigger command. It seems for some reason the trigger was breaking the UI for our case. Removing it fixed out issue

 cy.visit("https://test.com");
      cy.get('[class*="searchBox"] button').click();
      cy.get('[id="docsearch-input"]').clear();
      cy.get('[id="docsearch-input"]').invoke("val", jwt) **trigger("change")**<-removed and works now;
      cy.get('[id="docsearch-input"]').type(" {backspace}");

@jennifer-shehane jennifer-shehane removed the stage: needs information Not enough info to reproduce the issue label Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants