summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Kocoloski <kocolosk@apache.org>2019-07-29 14:48:40 -0400
committerAdam Kocoloski <kocolosk@apache.org>2019-08-09 07:58:04 -0400
commit608caaf12904effc104fc86a8525eb51425e2311 (patch)
tree072c59e046334d92f3724cda457c3d8618469962
parentaab0c51d8dca39d6556d4636edec20d14f65e36d (diff)
downloadcouchdb-608caaf12904effc104fc86a8525eb51425e2311.tar.gz
Increase default HTTP timeouts
These are needed to avoid timeouts on ASF Jenkins build farm. The httpotion client uses ibrowse underneath, and ibrowse has three separate timeouts. We are configuring two of them here: the overall request timeout, and one that detects inactivity on the connection. We set them slightly differently just to be able to differentiate which one fired from the logs.
-rw-r--r--test/elixir/lib/couch.ex12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/elixir/lib/couch.ex b/test/elixir/lib/couch.ex
index 58581b2fd..3c43ab152 100644
--- a/test/elixir/lib/couch.ex
+++ b/test/elixir/lib/couch.ex
@@ -50,6 +50,14 @@ defmodule Couch do
CouchDB library to power test suite.
"""
+ # These constants are supplied to the underlying HTTP client and control
+ # how long we will wait before timing out a test. The inactivity timeout
+ # specifically fires during an active HTTP response and defaults to 10_000
+ # if not specified. We're defining it to a different value than the
+ # request_timeout largely just so we know which timeout fired.
+ @request_timeout 60_000
+ @inactivity_timeout 55_000
+
def process_url("http://" <> _ = url) do
url
end
@@ -179,13 +187,13 @@ defmodule Couch do
Keyword.get(
options,
:timeout,
- Application.get_env(:httpotion, :default_timeout, 5000)
+ Application.get_env(:httpotion, :default_timeout, @request_timeout)
)
ib_options =
Keyword.merge(
Application.get_env(:httpotion, :default_ibrowse, []),
- Keyword.get(options, :ibrowse, [])
+ Keyword.get(options, :ibrowse, [{:inactivity_timeout, @inactivity_timeout}])
)
follow_redirects =