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

Error: Unexpected state in afterSpecHandler when chrome browser crashes #1172

Closed
AMEntwistle opened this issue Mar 26, 2024 · 2 comments
Closed

Comments

@AMEntwistle
Copy link

AMEntwistle commented Mar 26, 2024

Current Behaviour

When the chrome browser crashes during test execution, an error is thrown and the plugin does not exit gracefully:

Error: Unexpected state in afterSpecHandler: step-started (this might be a bug, please report at https://github.com/badeball/cypress-cucumber-preprocessor)
    at createError (/Users/entw003/Repos/cucumber-cypress-tests/node_modules/@badeball/cypress-cucumber-preprocessor/dist/helpers/error.js:9:12)
    at afterSpecHandler (/Users/entw003/Repos/cucumber-cypress-tests/node_modules/@badeball/cypress-cucumber-preprocessor/dist/plugin-event-handlers.js:276:43)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Object.handler (/Users/entw003/Repos/cucumber-cypress-tests/node_modules/cypress-on-fix/index.js:32:20)

Desired Behaviour

It would be great if the plugin would handle this error. Currently this throws cypress into an exit which means other plugins depending that run after this may not run. In our instance this actually leads to false positives. Chrome memory errors have been an issue with cypress for some time now so being able to handle this scenario would be beneficial.

Test code to reproduce

  1. Add a cy.pause() to a test
  2. Run the test in headed mod, e.g cypress run --env TAGS="@Focus" --browser chrome --headed
  3. When you hit the pause, trigger the crash by pasting this into the browser:chrome://inducebrowsercrashforrealz

-->

Versions

  • Cypress version: 13.6.6
  • Preprocessor version: 20.0.2
  • Node version: 18.0.0
@badeball
Copy link
Owner

Hi @AMEntwistle, I've fixed this with v20.0.3

@AMEntwistle
Copy link
Author

Fantastic, thank you @badeball

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants