-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Issues with .timeout() and network timeouts #393
Comments
@patrickisallen, I am having the same issue. However, frisby 2.0.5 has a unit test with your exact code in it, which passes when I run it. At any rate, I still get the same FetchError even after bumping up the Jasmine timeout interval and applying timeout through the 3rd it() parameter, or by tacking on .timeout() to the frisby I'm building up. |
@patrickisallen I think I just worked out a solution. Like you stated, setting the timeout through the 3rd it() parameter overrides the jasmine.DEFAULT_TIMEOUT_INTERVAL, but you must also chain a .timeout() call in your frisby spec buildup in order to have the test honor the timeout:
Also, note that the sequence of the timeout() call is important, as I've found that if you place it AFTER the get() call, in this case, the timeout is not set in time for the get() to fire; it must be placed BEFORE in order to work. Hope this helps. |
@gdereese I'll check it out! Thanks for looking into it. I've been blocked on this ever since I've posted. |
@gdereese , that's a good way. It's a great walkaround for now. My code is handling restful api using frisby like: frisby.get, frisby.post, frisby.put..., so it's not good for me to add timeout within the common method. |
When trying to upload large files through the post method I get the following errors:
Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
This can be solved by adding a timeout to the it() block like so
but the second error that I cannot seem to remedy is
FetchError: network timeout at: http://exampleUploadURL.com
The upload continues and finishes eventually but the test continues to fail and I have not found a proper solution to wait for the upload to completely finish. This is not an issue for smaller files as it does not reach a timeout.
After further investigation the included .timeout() function and setting the timeout through .globalSetup() and .setup() is not working as intended. The sample code below results in this error
The text was updated successfully, but these errors were encountered: