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

JasmineWD causes tests to hang if used with Jasmine's stopSpecOnExpectationFailure #93

Open
juliemr opened this issue Mar 19, 2018 · 2 comments
Assignees

Comments

@juliemr
Copy link
Member

juliemr commented Mar 19, 2018

JasmineWD causes tests to hang if used with Jasmine's stopSpecOnExpectationFailure. This prevents Protractor tests which rely on JasmineWD from using fast fail.

@juliemr juliemr self-assigned this Mar 19, 2018
@juliemr
Copy link
Member Author

juliemr commented Mar 20, 2018

This appears to be an effect of the adapter catching errors and calling done.fail, but calling done.fail inside a context where the error that Jasmine tries to throw then is caught and never passed back down to Jasmine. This comes from the callWhenIdle method which attempts to wait until the scheduler is done.

In Jasmine with stopSpecOnExpectationFailure, done.fail will add a failed expectation, which throws an error, which means that done.fail doesn't get a chance to clean up. It relies on a global error handler to catch the error and terminate the test.

Something about the webdriver control flow's scheduler is preventing the thrown error from reaching the global error handler, resulting in the hanging test.

@juliemr
Copy link
Member Author

juliemr commented Mar 20, 2018

All my attempts to fix this have had bad consequences somewhere in the test suite. I'm inclined to say that this is a fundamental issue with JasmineWD and fast fail, and that the best step forward is to encourage removing JasmineWD and reliance on the control flow in general. Prefer async/await for controlling asynchronous flow in tests.

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

1 participant