delayBody doesn't trigger timeout or sockettimeout unlike testing against an actual http server
See original GitHub issueWhen I run https://github.com/request/request against an actual HTTP server that delays closing the HTTP request after sending headers, I get a timeout or socket timeout. When I run it against nock configured to perform a delayBody with the same time, I do not get a timeout or socket timeout.
Take a look at https://github.com/jeffcharles/nock-timeout-testcase for an executable example. Running it on my machine results in:
Request sent back error: Error: ESOCKETTIMEDOUT
Nock should have failed with timeout but didn't
How can I configure Nock to timeout the socket given headers being sent back but the response not having been ended?
Issue Analytics
- State:
- Created 8 years ago
- Reactions:6
- Comments:7 (3 by maintainers)
Top Results From Across the Web
MockWebServer response delay - testing timeouts
I'm trying to test HTTP timeout scenarios using a MockWebServer which answers my test ... delayBody and . ... This doesnt return a...
Read more >Common Timeouts effecting Web Services, HTTP and SOAP ...
Use the ConnectionIOTimeOut property to specify the maximum amount of time, in seconds, that the J2EE server waits for the complete HTTP ......
Read more >Make resilient Go net/http servers using timeouts, deadlines ...
If the operation does not complete in the given time limit, a timeout occurs, and the operation is canceled. Initializing a net/http server...
Read more >Apache Http Client and Asynchronous HTTP client timeouts ...
As the usual explanation that “the connection timeout is the maximum time to establish a connection to the server” is not the most...
Read more >How to Get to the Bottom of Network Timeout Issues
Keywords could be in one of several different forms. Some of these may be: "SocketTimeOut", "Read timed out", and "Request timeout".
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
+1
i believe i tried same thing, following code will return
then block should not execute: Hello from Google!
while i would expectETIMEDOUT
mocha test/force-req-timeout.test.js --timeout=10000
http://stackoverflow.com/questions/36533807/how-to-etimedout-with-nock-and-request-library
👋 @hugoduraes Pedro is not maintaining nock any longer, I’m trying my best to help out (and onboard new maintainers hint hint). I’m on vacation right now, I can look into it after April 22. If anyone would like to send a PR, happy to review it after unless someone beats me to it 😃