From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp36.i.mail.ru (smtp36.i.mail.ru [94.100.177.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id D494446970E for ; Tue, 17 Dec 2019 03:03:40 +0300 (MSK) References: <20191204134320.27760-1-i.kosarev@tarantool.org> <1575648087.956039140@f128.i.mail.ru> <075c5646-976c-b673-2639-634333bf1eaf@tarantool.org> <1575988613.571435536@f381.i.mail.ru> From: Vladislav Shpilevoy Message-ID: Date: Tue, 17 Dec 2019 01:03:38 +0100 MIME-Version: 1.0 In-Reply-To: <1575988613.571435536@f381.i.mail.ru> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH] test: fix flaky socket test List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ilya Kosarev Cc: tarantool-patches@dev.tarantool.org Hi! Thanks for the fixes! > [008] -- true > [008] +- false > [008] ... > [008] received_message > [008] --- > [008] -- null > [008] +- > [008] ... > [008] from == nil -- expected true > [008] --- > [008] -- true > [008] +- false > [008] ... > [008] from > [008] --- > [008] -- null > [008] +- host: 127.0.0.1 > [008] + family: AF_INET > [008] + port: 59867 > [008] ... > [008] e == errno.EAGAIN -- expected true > [008] --- > [008] -- true > [008] +- false > [008] ... > [008] -- case: recv, zero datagram, explicit size > [008] sendto_zero(sending_socket, '127.0.0.1', receiving_socket_port) > ========================================================================= > > So socket.test.lua still is unstable. The command with 64 > socket.test.lua gives me an error in 100% cases. > > 4. Ok, I guess these are mac os specific issues. I haven't got mac os > machine access yet, however, I hope to get it soon and fix these problems. > I still tried to stabilize these cases; if it don't work, I will reconsider them later. > These are UDP issues, not Mac. See my commit with review fixes for details. > > 6. If we close socket in the main fiber, we might attempt to use closed > > socket in background fiber. > > And what? We don't care anymore for the background > fiber after the socket is not needed anymore. Ok, it will > stumble into errors in that fiber, but how does it affect > further execution of the test? > > 6. It affects further test execution, as far as it leads > to the following error: > > |[015] c:receive("*l", "Line: ") [015] --- [015] - null [015] -- closed [015] -- 'Line: Fu' [015] +- Connection reset by peer| > > Yeah, I've seen that error. But what I wanted to see here is why that error happens. Not just what happens. But why. I did investigation, and found that here: wch:put("Fu") c:send("354 Please type your message\n") sc:close() c:receive("*l", "Line: ") it was possible, that put(), send() and close() finish before the worker fiber manages to send anything to the client. I've tried to find a better fix, but all of them after all are about having a flag in the worker fiber, so your version is ok.