cypress: 'Aw, Snap' Error in Test Runner consistently occurs every minute when a test is running during cypress open
Current 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
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 19 (6 by maintainers)
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.
Yes, We also facing the same. when test runs for some time around 15 minutes. The scenario is in such a way that require this long test. We cannot divide into different testcase because its a one scenario tests.
In the end we have to use the solution as “numTestsKeptInMemory” to 0 in cypress.json and then run that testcase. it would be great if we get a solution for this.
various bugs we have come across after the cypress version 8.7. Due to which we are not able to update the version and use.
Cypress has become unstable after that (at least for our application )
@Nate-Watts this does seem strange that the tests consistently fail after 60 seconds. Could you not reproduce the failure with just
cy.wait(60000)
? If not, it would be helpful for you to iterate over the failing test removing certain test code, to hopefully narrow this bug down, because it’s too complex to reproduce on our end.