From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: "Alexander V. Tikhonov" Subject: [PATCH v1] test: app/socket flaky fails at 1951 line Date: Fri, 16 Aug 2019 09:15:18 +0300 Message-Id: <344efaff4bd8db559ecf4cd3635d645c68a72bde.1565936003.git.avtikhon@tarantool.org> To: Vladimir Davydov Cc: "Alexander V. Tikhonov" , tarantool-patches@freelists.org List-ID: Found that subtest for lua socket emulation on high loaded hosts closes the socket channel faster than write channel on finishes: wch:put("Fu") c:send("354 Please type your message\n") sc:close() It produces the following fail: [015] --- app/socket.result Thu Aug 15 02:55:31 2019 [015] +++ app/socket.reject Thu Aug 15 02:56:55 2019 [015] @@ -1951,8 +1951,7 @@ [015] c:receive("*l", "Line: ") [015] --- [015] - null [015] -- closed [015] -- 'Line: Fu' [015] +- Connection reset by peer [015] ... [015] c:receive() [015] --- To fix it we need some time delay before the closing routine call: wch:put("Fu") c:send("354 Please type your message\n") fiber.sleep(.1) sc:close() Fixes #4426 --- Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-4426-app-socket-1951 Issue: https://github.com/tarantool/tarantool/issues/4426 test/app/socket.result | 3 +++ test/app/socket.test.lua | 1 + 2 files changed, 4 insertions(+) diff --git a/test/app/socket.result b/test/app/socket.result index fd299424c..52b1ae3cb 100644 --- a/test/app/socket.result +++ b/test/app/socket.result @@ -1944,6 +1944,9 @@ c:send("354 Please type your message\n") --- - 29 ... +fiber.sleep(.1) +--- +... sc:close() --- - 1 diff --git a/test/app/socket.test.lua b/test/app/socket.test.lua index c72d41763..785a0b757 100644 --- a/test/app/socket.test.lua +++ b/test/app/socket.test.lua @@ -653,6 +653,7 @@ c:receive(4) c:receive("*l") wch:put("Fu") c:send("354 Please type your message\n") +fiber.sleep(.1) sc:close() c:receive("*l", "Line: ") c:receive() -- 2.17.1