[Tarantool-patches] [PATCH v3] test: flaky box/net.box_wait_connected_gh-3856

Alexander Turenko alexander.turenko at tarantool.org
Tue Jun 23 16:41:47 MSK 2020


LGTM.

I have a few comments, but it is just for appearance, nothing critical.
No need to re-review with me if you'll change it in the proposed ways.

WBR, Alexander Turenko.

> Co-authored-by: Alexander Turenko <alexander.turenko at tarantool.org>
> Co-authored-by: Vladislav Shpilevoy<v.shpilevoy at tarantool.org>

Typo: no space before '<'.

> diff --git a/test/box/net.box_wait_connected_gh-3856.test.lua b/test/box/net.box_wait_connected_gh-3856.test.lua
> index 29e997fb5..7721d3379 100644
> --- a/test/box/net.box_wait_connected_gh-3856.test.lua
> +++ b/test/box/net.box_wait_connected_gh-3856.test.lua
> @@ -1,8 +1,16 @@
>  net = require('net.box')
> +test_run = require('test_run').new()

It is not necessary anymore: you can just use backslash and don't use
delimiters. Up to you, but this way is shorter and looks more elegant.

> +test_run:cmd("setopt delimiter ';'")
> +function check_connection()
> +    local c = net.connect('8.8.8.8:1234', {wait_connected = false})
> +    local cstate = c.state
> +    c:close()
> +    return cstate
> +end;

It looks okay, but we can do it without defining a function.

 | do                      \
 |     local c = <...>     \
 |     local res = c.state \
 |     c:close()           \
 |     return res          \
 | end

Up to you.


More information about the Tarantool-patches mailing list