-
-
Notifications
You must be signed in to change notification settings - Fork 148
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 in 'before' hook causes tests to hang #476
Comments
Have been getting this issue as well, though only seems to happen when we run the tests within our jenkins pipeline. Guessing whatever is causing our hook to fail is only failing within there for some reason. Also, seems like this issue affects the after hooks as well. We don't use any before from what I could tell, but after hooks are used to clean up various application data. Using cypress 6.x.x as well. From other teams I work with, seems Cypress 5.x.x does not have this issue. |
We seems to have this same problem, but same as @vidarc says, only in our Jenkins pipeline. I haven't been able to identify an actual error from happening, but maybe a canceled request also counts as an 'error'. |
Update: What we've observed was that on teardown of a test Cypress cancels all running requests, which then are registered in the Cypress only allows one domain per test, this redirect caused everything to hang. The actual fix was in our application code: prevent outgoing requests if there is no valid authentication token. |
Due to personal reasons, the previous maintainers of this package are stepping down and handing the reigns over to me, a long-time contributor to the project and a user of it myself. This is a responsibility I'm very excited about. Furthermore, I'd like to thank @lgandecki ++ for all the work that they've done so far. Read more about the transfer of ownership here. The repository has however moved and all outstanding issues are being closed. This is not a reflection of the perceived importance of your reported issue. However, if after upgrading to the new version, you still find there to be an issue, feel free to open up another ticket or comment below. Please make sure to read CONTRIBUTING.md before doing so. |
Current behavior
I have some setup code in Mocha's
before
hook that logs in and makes some API requests to set up the database.If an error occurs in this hook the test hangs.
It gets stuck here with the timer stopped and the progress icon spins indefinitely.
This only happens if the feature file has more than one scenario.
Desired behavior
The tests should stop and show the error in the sidebar.
Test code to reproduce
I've created a minimal example https://github.com/mallison/cypress-cucumber-before-bug.
There are two feature files
In each of the tests I have the following
before
hook:Feature 1. has a single scenario and stops correctly showing the error in
before
.Feature 2. has two scenarios and hangs
There's at least one similar issue against Cypress itself -- cypress-io/cypress#9162 -- but I've verified that a non-Cucumber test doesn't have this issue.
Versions
The text was updated successfully, but these errors were encountered: