'Aw, Snap' Error in Test Runner consistently occurs every minute when a test is running during cypress open
See original GitHub issueCurrent behavior:
Cypress Test Runner displays the chrome ‘Aw, Snap’ error on any commands run after 60 seconds
Desired behavior:
To hopefully never see the ‘Aw, Snap’ error ever again.
Steps to reproduce:
Am able to reproduce in my own environment when simply running any tests that run commands after a test has been running for at least 60 seconds.
These are the custom Cypress commands that I am running in multiple tests. If I break up the single test file into multiple test files that run less than 60 seconds all of the tests pass. Longer than that and ‘Aw, Snap’ error is returned consistently every time.
Cypress.Commands.add('navigateCreateJob', () => {
cy.clearSessionStorage();
cy.wait(2000);
cy.visit(`${activeEndpoint}/#/jobs/create`);
cy.url().should('contain', '/#/jobs');
});
Cypress.Commands.add('createJob', (jobName, jobFunction) => {
cy.get(setupTestsMap.jobName).click().clear().type(jobName);
cy.get(setupTestsMap.functionName).click().clear().type(jobFunction);
cy.get(setupTestsMap.stateApplyDropDown).click();
if(jobFunction === 'state.apply'){
cy.get(setupTestsMap.selectFile).click().clear().type('CypressSleepJob40');
cy.get(setupTestsMap.cypressSleepJob40).click();
}
cy.get(setupTestsMap.save).click();
});
Cypress.Commands.add('navigateCreateSchedule', () => {
cy.clearSessionStorage();
cy.wait(2000);
cy.visit(`${activeEndpoint}/#/schedules/new/detail`);
cy.url().should('contain', '/#/');
});
Cypress.Commands.add('createSchedule', (scheduleName, jobCommand, target, frequency, time) => {
cy.get(setupTestsMap.scheduleName).click().clear().type(scheduleName);
cy.get(setupTestsMap.jobCommand).click().clear().type(jobCommand);
cy.get(setupTestsMap.clickDropDown).click();
cy.get(setupTestsMap.target).click().clear().type(target);
cy.get(setupTestsMap.clickDropDown).click();
cy.get(setupTestsMap.frequency).click().clear().type(frequency);
cy.get(setupTestsMap.timeDrop).select(time);
cy.get(setupTestsMap.runNow).click();
cy.get(setupTestsMap.saveSchedule).click();
});
describe('Scheduler List Page -- Sort', () => {
it('Setup Testing Jobs', () => {
cy.login();
cy.wait(6000);
cy.createSleepFile();
cy.navigateCreateJob();
cy.createJob('aa_CypressSleepJob', 'state.apply');
cy.navigateCreateJob();
cy.createJob('zz_CypressSleepJob', 'state.apply');
});
it('Setup Testing Jobs #2', () => {
cy.login();
cy.wait(6000);
cy.navigateCreateJob();
cy.createJob('Yao Ping #11', 'test.ping');
cy.navigateCreateJob();
cy.createJob('Disable Me', 'test.ping');
})
});
Versions
Cypress 3.0.1 MacOs Sierra Chrome 67
Issue Analytics
- State:
- Created 5 years ago
- Comments:18 (6 by maintainers)
Top Results From Across the Web
“Aw, Snap!” errors in Chrome under Cypress - Mike Fettes
This has started happening with my test scripts, presumably due to one or more upgrades of Chrome. It took a bit of tinkering, ......
Read more >Cypress long automation script crashes the Chrome browser ...
Cypress has two running modes: debugging/development mode, started with cypress open , and a test running mode, started with cypress run .
Read more >Common Error Messages | Sauce Labs Documentation
You'll see this error when your test suite is still running in a session that has lasted more than 1800 seconds (30 minutes)....
Read more >Chrome aw snap, how to solve the error (2022) - SupportHost
The first test is to reload the page. If you still have the error chrome aw snap using incognito mode or clear the...
Read more >Fixing Cypress errors part 1: chromium out of memory crashes
Chromium crashing is one of the issues I kept seeing in the pipeline. It would happen even when no code was changed and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Then I’m very confident its due to the debugging features we enable with
cypress open
.During a
cypress run
we turn everything off since that mode is optimized for running to completion - whereascypress open
is about iterating and writing tests.I would first say that you should really only be using
cypress open
to run a single test - doing anything more than that is potentially volatile. We’ve written about it in some issues and have plans to improve that experience, but that is honestly the truth of it today.There are some older ones too like these…
You can turn off the debugging features of Cypress by writing
{ numTestsKeptInMemory: 0 }
. That may immediately solve the issue.As for the
{ chromeWebSecurity: false }
bits - the reason I ask is that in Chrome 67, Google started running experiments enable site level isolation. The problem is that its a known issue they don’t take into account turning off web security. When Cypress does its thing, I can see how its possible this can lead to a crash.Read my comment here for a workaround you can pop in today: https://github.com/cypress-io/cypress/issues/1951#issuecomment-401579981
When
3.0.3
comes out it will have this flag in there by default.Can you also try running Electron 59 locally with
cypress open
? That would help isolate whether this is a browser version specifically problem (with Chrome) or this is an application / Cypress specific issue. If it doesn’t happen in Electron 59 (which is Chromium 59) then I’m confident its related to the Chrome 67 upgrades.In the past you were likely seeing these messages for a completely different reason - possibly because you may also have an application that puts significant pressure on the browser’s memory.
Yup this seems like a memory issue caused by how we hold onto references for debuggability with
cypress open
.Likely will be fixed by what I said in my previous comment.