Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: "Alexander V. Tikhonov" <avtikhon@tarantool.org>,
	Sergey Bronnikov <sergeyb@tarantool.org>,
	Alexander Turenko <alexander.turenko@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v2] test: flaky box/net.box_wait_connected_gh-3856
Date: Sun, 21 Jun 2020 17:50:10 +0200	[thread overview]
Message-ID: <baccd41a-e997-834d-5236-a04cfd522ff9@tarantool.org> (raw)
In-Reply-To: <4351b421b56115e2d8c35f60fdb5e8ba43a7b9fe.1592628521.git.avtikhon@tarantool.org>

Hi! Thanks for the patch!

> diff --git a/test/box/net.box_wait_connected_gh-3856.result b/test/box/net.box_wait_connected_gh-3856.result
> index 9234e6cb9..0ac6d8a0b 100644
> --- a/test/box/net.box_wait_connected_gh-3856.result
> +++ b/test/box/net.box_wait_connected_gh-3856.result
> @@ -1,19 +1,22 @@
>  net = require('net.box')
>  ---
>  ...
> +test_run = require('test_run').new()
> +---
> +...
>  --
>  -- gh-3856: wait_connected = false is ignored.
>  --
> -c = net.connect('8.8.8.8:123456', {wait_connected = false})
> ----
> -...
> -c
> +do                                                            \
> +    c = net.connect('8.8.8.8:1234', {wait_connected = false}) \
> +    return c                                                  \

You said you grab all connection fields, but you don't. This
construction is 100% the same as

    c = net.connect('8.8.8.8:1234', {wait_connected = false})

Without 'do', 'return', and 'end'. In the original fix from
Alexander Tu. I see that he returned c.state, not just c.
But since you may need to call close() anyway, you probably
should return

    c, c.state

So as to print the second value and close the first value.
Another option - wrap all that into a function. Which calls
close() inside, and returns the state.

> +end
>  ---
>  - opts:
>      wait_connected: false
>    host: 8.8.8.8
>    state: initial
> -  port: '123456'
> +  port: '1234'
>  ...
>  c:close()

  reply	other threads:[~2020-06-21 15:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-20  4:50 Alexander V. Tikhonov
2020-06-21 15:50 ` Vladislav Shpilevoy [this message]
2020-06-22 14:07   ` Alexander V. Tikhonov
2020-06-21 18:41 ` Alexander Turenko
2020-06-22 14:05   ` Alexander V. Tikhonov
2020-06-26  9:52 ` 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=baccd41a-e997-834d-5236-a04cfd522ff9@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=avtikhon@tarantool.org \
    --cc=sergeyb@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2] test: flaky box/net.box_wait_connected_gh-3856' \
    /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