Skip to content

Commit

Permalink
tests(*) increase timeouts for helper clients
Browse files Browse the repository at this point in the history
Travis CI seems to be causing up to 30 second delays when DNS fails
to resolve (which is a situation we trigger deliberately in our
tests, and used to be quick).

We increase maximum timeouts to account for that.
  • Loading branch information
hishamhm committed Aug 13, 2019
1 parent c12a4a3 commit ef27fd4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion spec/02-integration/05-proxy/10-balancer_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ end


local function poll_wait_health(upstream_id, host, port, value, admin_port)
local hard_timeout = ngx.now() + 10
local hard_timeout = ngx.now() + 70
while ngx.now() < hard_timeout do
local health = get_upstream_health(upstream_id, admin_port)
if health then
Expand Down
8 changes: 4 additions & 4 deletions spec/helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ local function proxy_client(timeout)
local proxy_ip = get_proxy_ip(false)
local proxy_port = get_proxy_port(false)
assert(proxy_ip, "No http-proxy found in the configuration")
return http_client(proxy_ip, proxy_port, timeout)
return http_client(proxy_ip, proxy_port, timeout or 60000)
end

--- returns a pre-configured `http_client` for the Kong SSL proxy port.
Expand All @@ -485,7 +485,7 @@ local function proxy_ssl_client(timeout, sni)
local proxy_ip = get_proxy_ip(true)
local proxy_port = get_proxy_port(true)
assert(proxy_ip, "No https-proxy found in the configuration")
local client = http_client(proxy_ip, proxy_port, timeout)
local client = http_client(proxy_ip, proxy_port, timeout or 60000)
assert(client:ssl_handshake(nil, sni, false)) -- explicit no-verify
return client
end
Expand All @@ -501,7 +501,7 @@ local function admin_client(timeout, forced_port)
end
end
assert(admin_ip, "No http-admin found in the configuration")
return http_client(admin_ip, forced_port or admin_port, timeout)
return http_client(admin_ip, forced_port or admin_port, timeout or 60000)
end

--- returns a pre-configured `http_client` for the Kong admin SSL port.
Expand All @@ -515,7 +515,7 @@ local function admin_ssl_client(timeout)
end
end
assert(admin_ip, "No https-admin found in the configuration")
local client = http_client(admin_ip, admin_port, timeout)
local client = http_client(admin_ip, admin_port, timeout or 60000)
assert(client:ssl_handshake())
return client
end
Expand Down

0 comments on commit ef27fd4

Please sign in to comment.