summaryrefslogtreecommitdiff
path: root/test/parallel/test-http-agent-timeout-option.js
AgeCommit message (Collapse)Author
2019-02-07test: refactor test-http-agent-timeout-optionLuigi Pinca
There is no need to establish a TCP connection. It is sufficient to test that the listener that forwards the `'timeout'` event from the socket to the `ClientRequest` instance is added to the socket. PR-URL: https://github.com/nodejs/node/pull/25886 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-02-01test: refactor test-http-agent-timeout-optionLuigi Pinca
Fix flakyness caused by usage of a non-routable IP address. Refs: https://github.com/nodejs/node/pull/25488#issuecomment-459385146 PR-URL: https://github.com/nodejs/node/pull/25854 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2019-01-31http: make timeout event work with agent timeoutLuigi Pinca
The `'timeout'` event is currently not emitted on the `ClientRequest` instance when the socket timeout expires if only the `timeout` option of the agent is set. This happens because, under these circumstances, `listenSocketTimeout()` is not called. This commit fixes the issue by calling it also when only the agent `timeout` option is set. PR-URL: https://github.com/nodejs/node/pull/25488 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>