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

Alexander V. Tikhonov avtikhon at tarantool.org
Mon Jun 22 17:07:28 MSK 2020


Hi Vlad, thanks for your review, I've corrected the test as you
suggested, please check my comments below.

On Sun, Jun 21, 2020 at 05:50:10PM +0200, Vladislav Shpilevoy wrote:
> 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.
> 

Ok, I've updated the test with the new function for it.

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


More information about the Tarantool-patches mailing list