Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: imeevma@tarantool.org
Cc: avtikhon@tarantool.org, tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH v1 1/1] box: increase connection timeout in "net.box.test.lua"
Date: Tue, 16 Jul 2019 00:13:17 +0200	[thread overview]
Message-ID: <b904fc37-f04d-6217-953e-7ea8fc98f177@tarantool.org> (raw)
In-Reply-To: <667a69a7b37236d443212da8289c34d2bc56c722.1563185673.git.imeevma@gmail.com>

LGTM.

On 15/07/2019 12:20, imeevma@tarantool.org wrote:
> The "box/net.box.test.lua" test contains a check that the error
> received contains a 'timed out'. But in cases when testing was
> conducted on a slow computer or in the case of a very large load,
> it is possible that the connection time-out will be reached
> earlier than the mentioned error. In this case, the error "Invalid
> argument" will be returned. To prevent this from happening,
> this patch will increase the connection timeout.
> 
> Closes #4341
> ---
> The patch was tested by @avtikhon. The specified error no longer
> occurs.
> 
> https://github.com/tarantool/tarantool/issues/4341
> https://github.com/tarantool/tarantool/tree/imeevma/gh-4341-increase-connection-timeout
> 
>  test/box/net.box.result   | 10 ++++++++--
>  test/box/net.box.test.lua |  8 ++++++--
>  2 files changed, 14 insertions(+), 4 deletions(-)
> 
> diff --git a/test/box/net.box.result b/test/box/net.box.result
> index 6467629..0803956 100644
> --- a/test/box/net.box.result
> +++ b/test/box/net.box.result
> @@ -2109,6 +2109,9 @@ test_run:cmd("setopt delimiter ';'");
>  ---
>  - true
>  ...
> +need_stop = false;
> +---
> +...
>  greeting =
>  "Tarantool 1.7.3 (Lua console)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ..
>  "type 'help' for interactive help~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
> @@ -2120,7 +2123,9 @@ socket = require('socket');
>  srv = socket.tcp_server('localhost', 0, {
>      handler = function(fd)
>          local fiber = require('fiber')
> -        fiber.sleep(0.1)
> +        while not need_stop do
> +            fiber.sleep(0.01)
> +        end
>          fd:write(greeting)
>      end
>  });
> @@ -2130,7 +2135,7 @@ srv = socket.tcp_server('localhost', 0, {
>  port = srv:name().port
>  nb = net.new('localhost:' .. port, {
>      wait_connected = true, console = true,
> -    connect_timeout = 0.01
> +    connect_timeout = 0.1
>  });
>  ---
>  ...
> @@ -2138,6 +2143,7 @@ nb.error:find('timed out') ~= nil;
>  ---
>  - true
>  ...
> +need_stop = true
>  nb:close();
>  ---
>  ...
> diff --git a/test/box/net.box.test.lua b/test/box/net.box.test.lua
> index a84f6db..3677b30 100644
> --- a/test/box/net.box.test.lua
> +++ b/test/box/net.box.test.lua
> @@ -837,6 +837,7 @@ c:close()
>  
>  -- Test for connect_timeout > 0 in netbox connect
>  test_run:cmd("setopt delimiter ';'");
> +need_stop = false;
>  greeting =
>  "Tarantool 1.7.3 (Lua console)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ..
>  "type 'help' for interactive help~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
> @@ -844,7 +845,9 @@ socket = require('socket');
>  srv = socket.tcp_server('localhost', 0, {
>      handler = function(fd)
>          local fiber = require('fiber')
> -        fiber.sleep(0.1)
> +        while not need_stop do
> +            fiber.sleep(0.01)
> +        end
>          fd:write(greeting)
>      end
>  });
> @@ -852,9 +855,10 @@ port = srv:name().port
>  -- we must get timeout
>  nb = net.new('localhost:' .. port, {
>      wait_connected = true, console = true,
> -    connect_timeout = 0.01
> +    connect_timeout = 0.1
>  });
>  nb.error:find('timed out') ~= nil;
> +need_stop = true
>  nb:close();
>  -- we must get peer closed
>  nb = net.new('localhost:' .. port, {
> 

  reply	other threads:[~2019-07-15 22:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-15 10:20 [tarantool-patches] " imeevma
2019-07-15 22:13 ` Vladislav Shpilevoy [this message]
2019-07-18  4:27 ` [tarantool-patches] " Kirill Yukhin

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=b904fc37-f04d-6217-953e-7ea8fc98f177@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=avtikhon@tarantool.org \
    --cc=imeevma@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH v1 1/1] box: increase connection timeout in "net.box.test.lua"' \
    /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