[PATCH] test: fix http_client.test.lua with curl-7.62

Alexander Turenko alexander.turenko at tarantool.org
Sun Dec 2 18:52:09 MSK 2018


curl-7.61.1

```
tarantool> require('http.client').new():get('http://localhost:0')
---
- status: 595
  reason: Couldn't connect to server
```

curl-7.62

```
tarantool> require('http.client').new():get('http://localhost:0')
---
- error: 'curl: URL using bad/illegal format or missing URL'
...
```

curl-7.62 returns CURLE_URL_MALFORMAT is case of zero port and tarantool
raises an error in the case. I think this behaviour is valid, so I fixed
the test.
---

no issue
https://github.com/tarantool/tarantool/tree/Totktonada/fix-http-client-test

The branch is based on 2.1. Please, cherry-pick it also to 1.10.

 test/app-tap/http_client.test.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/app-tap/http_client.test.lua b/test/app-tap/http_client.test.lua
index 90ea51b3a..10a3728f8 100755
--- a/test/app-tap/http_client.test.lua
+++ b/test/app-tap/http_client.test.lua
@@ -73,7 +73,7 @@ local function test_http_client(test, url, opts)
     test:ok(r.body:match("hello") ~= nil, "body")
     test:ok(tonumber(r.headers["content-length"]) > 0,
         "content-length > 0")
-    test:is(client.get("http://localhost:0/").status, 595, 'bad url')
+    test:is(client.get("http://localhost:1/").status, 595, 'cannot connect')
 
     local r = client.request('GET', url, nil, opts)
     test:is(r.status, 200, 'request')
-- 
2.19.2




More information about the Tarantool-patches mailing list