Tarantool development patches archive
 help / color / mirror / Atom feed
From: Serge Petrenko <sergepetrenko@tarantool.org>
To: vdavydov.dev@gmail.com
Cc: tarantool-patches@freelists.org,
	Serge Petrenko <sergepetrenko@tarantool.org>
Subject: [PATCH] test: fix net.box occasional failure. Again
Date: Tue,  9 Jul 2019 12:31:11 +0300	[thread overview]
Message-ID: <20190709093111.21718-1-sergepetrenko@tarantool.org> (raw)

The test regarding logging corrupted rows failed occasionally with
```
[016]  test_run:grep_log('default', 'Got a corrupted row.*')
[016]  ---
[016] -- 'Got a corrupted row:'
[016] +- null
[016]  ...
```
The logs then had
```
[010] 2019-07-06 19:36:16.857 [13046] iproto sio.c:261 !> SystemError writev(1),
called on fd 23, aka unix/:(socket), peer of unix/:(socket): Broken pipe
```
instead of the expected message.

This happened, because we closed a socket before tarantool could write a
greeting to the client, the connection was then closed, and execution
never got to processing the malformed request and thus printing the
desired message to the log.

To fix this, actually read the greeting prior to writing new data and
closing the socket.

Follow-up #4273
---

https://github.com/tarantool/tarantool/issues/4273
https://github.com/tarantool/tarantool/tree/sp/gh-4273-netbox-flaky

The patch should also appear in 1.10 and 2.1.
It is also worth cherry-picking commit 07a84a97d8fafc9d32019578757244f96f26aa05
(test: fix net.box occasional failure.) to 1.10 and 2.1.
We didn't do it initially.

 test/box/net.box.result   | 4 ++++
 test/box/net.box.test.lua | 1 +
 2 files changed, 5 insertions(+)

diff --git a/test/box/net.box.result b/test/box/net.box.result
index ca976ab21..a18546d12 100644
--- a/test/box/net.box.result
+++ b/test/box/net.box.result
@@ -3855,6 +3855,10 @@ box.cfg{log_level=6}
 sock = socket.tcp_connect(LISTEN.host, LISTEN.service)
 ---
 ...
+sock:read(9)
+---
+- Tarantool
+...
 -- we need to have a packet with correctly encoded length,
 -- so that it bypasses iproto length check, but cannot be
 -- decoded in xrow_header_decode
diff --git a/test/box/net.box.test.lua b/test/box/net.box.test.lua
index fde496283..07558a0dc 100644
--- a/test/box/net.box.test.lua
+++ b/test/box/net.box.test.lua
@@ -1551,6 +1551,7 @@ box.cfg{readahead = readahead}
 log_level = box.cfg.log_level
 box.cfg{log_level=6}
 sock = socket.tcp_connect(LISTEN.host, LISTEN.service)
+sock:read(9)
 -- we need to have a packet with correctly encoded length,
 -- so that it bypasses iproto length check, but cannot be
 -- decoded in xrow_header_decode
-- 
2.20.1 (Apple Git-117)

             reply	other threads:[~2019-07-09  9:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-09  9:31 Serge Petrenko [this message]
2019-07-09 11:10 ` Vladimir Davydov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190709093111.21718-1-sergepetrenko@tarantool.org \
    --to=sergepetrenko@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [PATCH] test: fix net.box occasional failure. Again' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox