[tarantool-patches] [PATCH] httpc: temporary disable redirecting test case

Alexander Turenko alexander.turenko at tarantool.org
Wed Apr 24 13:57:03 MSK 2019


Redirects can work improperly with libcurl-7.30 and older. CentOS 7
provides libcurl-7.29, so app-tap/http_client.test.lua fails on the
corresponding test case in CI. We need to disable the test case until
#4180 will be resolved.

While we are here fixed httpd.py to write a response at once, not
char-by-char (the typo from daf1ced8). See
gevent/pywsgy.py::process_result().

Related to #4119 and #4180.
---

It is needed on master and 2.1 to prevents CI fails. The test case
should be enabled back after #4180.

https://github.com/tarantool/tarantool/issues/4180
https://github.com/tarantool/tarantool/tree/Totktonada/gh-4180-httpc-disable-redirecting-test-case

 test/app-tap/http_client.test.lua | 6 +++++-
 test/app-tap/httpd.py             | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/test/app-tap/http_client.test.lua b/test/app-tap/http_client.test.lua
index 413fc3400..4eee21ebb 100755
--- a/test/app-tap/http_client.test.lua
+++ b/test/app-tap/http_client.test.lua
@@ -62,7 +62,7 @@ local function stop_server(test, server)
 end
 
 local function test_http_client(test, url, opts)
-    test:plan(12)
+    test:plan(11)
 
     -- gh-4136: confusing httpc usage error message
     local ok, err = pcall(client.request, client)
@@ -85,6 +85,9 @@ local function test_http_client(test, url, opts)
     local r = client.request('GET', url, nil, opts)
     test:is(r.status, 200, 'request')
 
+    -- XXX: enable after resolving of gh-4180: httpc: redirects
+    -- are broken with libcurl-7.30 and older
+    --[[
     -- gh-4119: specify whether to follow 'Location' header
     test:test('gh-4119: follow location', function(test)
         test:plan(7)
@@ -108,6 +111,7 @@ local function test_http_client(test, url, opts)
         test:is(r.body, 'redirecting', 'do not follow location: body')
         test:is(r.headers['location'], '/', 'do not follow location: header')
     end)
+    ]]--
 end
 
 --
diff --git a/test/app-tap/httpd.py b/test/app-tap/httpd.py
index dbfddfdd8..b4662bc1f 100755
--- a/test/app-tap/httpd.py
+++ b/test/app-tap/httpd.py
@@ -47,7 +47,7 @@ def long_query():
 
 def redirect():
     code = "302 Found"
-    body = "redirecting"
+    body = ["redirecting"]
     headers = [('Location', '/')]
     return code, body, headers
 
-- 
2.21.0





More information about the Tarantool-patches mailing list