From: Tomas Krizek Date: Wed, 10 Nov 2021 13:12:09 +0000 (+0100) Subject: tests/config: increate http timeouts to 16s X-Git-Tag: v5.4.3~5^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a267b38995aec51e5d5e5819bcdbc1ca325ca67b;p=thirdparty%2Fknot-resolver.git tests/config: increate http timeouts to 16s On some platforms in CI, even 8s doesn't seem sufficient enough to guarantee stability. Hopefully this improves the situation. --- diff --git a/modules/daf/daf_http.test.lua b/modules/daf/daf_http.test.lua index d89b180db..20d5f9058 100644 --- a/modules/daf/daf_http.test.lua +++ b/modules/daf/daf_http.test.lua @@ -37,7 +37,7 @@ else -- helper for returning useful values to test on -- local function http_get(uri) --- local headers, stream = assert(request.new_from_uri(uri):go()) +-- local headers, stream = assert(request.new_from_uri(uri):go(16)) -- local body = assert(stream:get_body_as_string()) -- return tonumber(headers:get(':status')), body, headers:get('content-type') -- end @@ -46,7 +46,7 @@ else local req = assert(request.new_from_uri(baseuri .. uri)) req.headers:upsert(':method', method) req:set_body(reqbody) - local headers, stream = assert(req:go()) + local headers, stream = assert(req:go(16)) local ansbody = assert(stream:get_body_as_string()) return tonumber(headers:get(':status')), ansbody, headers:get('content-type') end diff --git a/modules/http/http.test.lua b/modules/http/http.test.lua index 2d0752fff..b882f1073 100644 --- a/modules/http/http.test.lua +++ b/modules/http/http.test.lua @@ -45,7 +45,7 @@ else -- helper for returning useful values to test on local function http_get(uri) - local headers, stream = assert(request.new_from_uri(uri .. '/'):go()) + local headers, stream = assert(request.new_from_uri(uri .. '/'):go(16)) local body = assert(stream:get_body_as_string()) return tonumber(headers:get(':status')), body, headers:get('content-type') end diff --git a/modules/http/http_doh.test.lua b/modules/http/http_doh.test.lua index 60f5cc0a9..f0685cb15 100644 --- a/modules/http/http_doh.test.lua +++ b/modules/http/http_doh.test.lua @@ -49,7 +49,7 @@ function parse_pkt(input, desc) end local function check_ok(req, desc) - local headers, stream, errno = req:go(8) -- randomly chosen timeout by tkrizek + local headers, stream, errno = req:go(16) if errno then local errmsg = stream nok(errmsg, desc .. ': ' .. errmsg) @@ -63,7 +63,7 @@ local function check_ok(req, desc) end local function check_err(req, exp_status, desc) - local headers, errmsg, errno = req:go(8) -- randomly chosen timeout by tkrizek + local headers, errmsg, errno = req:go(16) if errno then nok(errmsg, desc .. ': ' .. errmsg) return diff --git a/modules/http/test_tls/tls.test.lua b/modules/http/test_tls/tls.test.lua index 481d7b87f..7d5c437bb 100644 --- a/modules/http/test_tls/tls.test.lua +++ b/modules/http/test_tls/tls.test.lua @@ -43,7 +43,7 @@ else req.ctx:setVerify(openssl_ctx.VERIFY_NONE) end - local headers = assert(req:go()) + local headers = assert(req:go(16)) return tonumber(headers:get(':status')) end @@ -168,7 +168,7 @@ else store:add('ca.crt') req.ctx:setVerify(openssl_ctx.VERIFY_PEER) - local headers = assert(req:go()) + local headers = assert(req:go(16)) local code = tonumber(headers:get(':status')) same(code, 200, desc) end diff --git a/tests/config/doh2.test.lua b/tests/config/doh2.test.lua index 069e72b75..ef4325633 100644 --- a/tests/config/doh2.test.lua +++ b/tests/config/doh2.test.lua @@ -50,7 +50,7 @@ function parse_pkt(input, desc) end local function check_ok(req, desc) - local headers, stream, errno = req:go(8) -- randomly chosen timeout by tkrizek + local headers, stream, errno = req:go(16) if errno then local errmsg = stream nok(errmsg, desc .. ': ' .. errmsg) @@ -64,7 +64,7 @@ local function check_ok(req, desc) end --local function check_err(req, exp_status, desc) --- local headers, errmsg, errno = req:go(8) -- randomly chosen timeout by tkrizek +-- local headers, errmsg, errno = req:go(16) -- if errno then -- nok(errmsg, desc .. ': ' .. errmsg) -- return