Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: Serge Petrenko <sergepetrenko@tarantool.org>
Cc: kostja@tarantool.org, tarantool-patches@freelists.org
Subject: Re: [PATCH v2] tarantoolctl: return an error on enter to a dead socket.
Date: Tue, 21 Aug 2018 16:26:26 +0300	[thread overview]
Message-ID: <20180821132626.prljvymufahujzt6@esperanza> (raw)
In-Reply-To: <17F09AB8-AD92-46D6-BB41-6FF109C336CA@tarantool.org>

On Tue, Aug 21, 2018 at 03:51:57PM +0300, Serge Petrenko wrote:
> >> +-- check enter
> >> +do
> >> +    local dir = fio.tempdir()
> >> +
> >> +    local code = [[ box.cfg{} ]]
> >> +    create_script(dir, 'script.lua', code)
> >> +
> >> +    local status, err = pcall(function()
> >> +        test:test("check error codes in case of enter", function(test_i)
> >> +            test_i:plan(10)
> >> +            check_ok(test_i, dir, 'enter', 'script', 1, nil, "Can't connect to")
> >> +            local console_sock = 'script.control'
> >> +            console_sock = fio.pathjoin(dir, console_sock)
> >> +            test_i:is(fio.path.exists(console_sock), false, "directory clean")
> >> +            check_ok(test_i, dir, 'start', 'script', 0)
> >> +            tctl_wait_start(dir, 'script')
> >> +            test_i:is(fio.path.exists(console_sock), true,
> >> +                      "unix socket created")
> >> +            check_ok(test_i, dir, 'stop', 'script', 0)
> >> +            wait_delete(console_sock)
> > 
> > There's tctl_wait_stop() for this.
> 
> Yes, fixed. New diff is below.
> 
> > 
> > Anyway, why do you need to start/stop instance before trying to enter
> > it? AFAIU you just want to check that 'tarantoolctl enter' returns an
> > error when called on a closed socket so the code below should be enough.
> 
> I wanted to stress that I’m using a correct path to socket. Not just creating some
> Random file at some random place and then expecting `tarantoolctl enter` to fail.
> Also test that there is no socket after `tarantoolctl stop` was a request by Kostja
> For previous patch, but it is irrelevant now. We can remove it, if you want, but
> I believe it’s some extra coverage, nothing wrong with that.

OK, pushed to 1.10.

      reply	other threads:[~2018-08-21 13:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-21  6:56 Serge Petrenko
2018-08-21 12:28 ` Vladimir Davydov
2018-08-21 12:51   ` Serge Petrenko
2018-08-21 13:26     ` Vladimir Davydov [this message]

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=20180821132626.prljvymufahujzt6@esperanza \
    --to=vdavydov.dev@gmail.com \
    --cc=kostja@tarantool.org \
    --cc=sergepetrenko@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [PATCH v2] tarantoolctl: return an error on enter to a dead socket.' \
    /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