From: Vladimir Davydov <vdavydov.dev@gmail.com> To: Olga Arkhangelskaia <arkholga@tarantool.org> Cc: tarantool-patches@freelists.org Subject: Re: [tarantool-patches] [PATCH v2 2/3] Syslog remote destination test Date: Tue, 17 Jul 2018 17:37:03 +0300 [thread overview] Message-ID: <20180717143703.qmjtbtnj7hnsjax2@esperanza> (raw) In-Reply-To: <1531836924.196967966@f175.i.mail.ru> On Tue, Jul 17, 2018 at 05:15:24PM +0300, Olga Arkhangelskaia wrote: > >> test/app-tap/syslog_remote.test.lua | 37 +++++++++++++++++++++++++++++++++++++ > >> 1 file changed, 37 insertions(+) > >> create mode 100755 test/app-tap/syslog_remote.test.lua > > > >In review to v1 I asked you to fold this test in box-tap/cfg. > >Any reason why this couldn't/shouldn't be done? > Sorry, I did not notice that comment. However, why in box-tap/cfg.test.lua and not separately? Hmm, good question. For one thing, what's you're testing here is not a part of the application server, but is rather relevant to the box API so the test should live in box/ or box-tap/. Since box-tap/cfg.test.lua is supposed to test box.cfg() and already has all the infrastructure for starting a new tarantool instance (I mean, run_code), it feels like a good choice. Anyway, we don't usually create a new test file for each bug/feature - that'd be an overkill. We try to group tests by subsystem. I suppose, in your particular case it would be acceptable to introduce a new test file, but it should test both unix and udp sockets then IMHO, which means that you need the run_code() from box-tap/cfg.test.lua, so why not just fold the test cases there - they aren't that big, are they. > > > > >> > >> diff --git a/test/app-tap/syslog_remote.test.lua b/test/app-tap/syslog_remote.test.lua > >> new file mode 100755 > >> index 000000000..01a75fa64 > >> --- /dev/null > >> +++ b/test/app-tap/syslog_remote.test.lua > >> @@ -0,0 +1,37 @@ > >> +#!/usr/bin/env tarantool > >> + > >> +local tap = require('tap') > >> +local socket = require('socket') > >> +local os = require('os') > >> +local test = tap.test("syslog_remote") > >> +local log = require('log') > >> +local errno = require('errno') > >> + > >> +local addr = '127.0.0.1' > >> +local port = 1000 + math.random(32768) > > > >No, that's not what I meant. Using a random port like that won't save > >your from conflicts. You should retry until 'bind' succeeds. > And how to choose number of attempts? Ten is enough? I guess so. Even if you have half of the ports busy, after ten attempts the probability of repeatedly choosing a busy port is less than 0.1%, which is acceptable, I think. Also, I asked you to test invalid syslog destination (non-existing unix socket or host address). Please do so as to cover the error paths.
next prev parent reply other threads:[~2018-07-17 14:37 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-07-17 9:02 [tarantool-patches] [PATCH v2 0/3] Syslog destination Olga Arkhangelskaia 2018-07-17 9:02 ` [tarantool-patches] [PATCH v2 1/3] Configurable syslog destination Olga Arkhangelskaia 2018-07-17 14:02 ` Vladimir Davydov 2018-07-17 9:02 ` [tarantool-patches] [PATCH v2 2/3] Syslog remote destination test Olga Arkhangelskaia 2018-07-17 14:07 ` Vladimir Davydov 2018-07-17 14:15 ` Re[2]: " Olga Arkhangelskaia 2018-07-17 14:37 ` Vladimir Davydov [this message] 2018-07-17 9:02 ` [tarantool-patches] [PATCH v2 3/3] Syslog destination test unix socket Olga Arkhangelskaia
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=20180717143703.qmjtbtnj7hnsjax2@esperanza \ --to=vdavydov.dev@gmail.com \ --cc=arkholga@tarantool.org \ --cc=tarantool-patches@freelists.org \ --subject='Re: [tarantool-patches] [PATCH v2 2/3] Syslog remote destination test' \ /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