<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">2018-08-08 12:00 GMT+03:00 Vladimir Davydov <span dir="ltr"><<a href="mailto:vdavydov.dev@gmail.com" target="_blank">vdavydov.dev@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, Aug 07, 2018 at 11:16:03PM +0300, Olga Arkhangelskaia wrote:<br>
> diff --git a/test/box-tap/cfg.test.lua b/test/box-tap/cfg.test.lua<br>
> index 53e3c629a..cb61607fe 100755<br>
> --- a/test/box-tap/cfg.test.lua<br>
> +++ b/test/box-tap/cfg.test.lua<br>
> @@ -6,7 +6,7 @@ local socket = require('socket')<br>
>  local fio = require('fio')<br>
>  local uuid = require('uuid')<br>
>  local msgpack = require('msgpack')<br>
> -test:plan(93)<br>
> +test:plan(95)<br>
>  <br>
>  ------------------------------<wbr>------------------------------<wbr>--------------------<br>
>  -- Invalid values<br>
> @@ -455,5 +455,80 @@ code = string.format(code_fmt, dir, instance_uuid, uuid.new())<br>
>  test:is(run_script(code), PANIC, "replicaset_uuid mismatch")<br>
>  fio.rmdir(dir)<br>
>  <br>
> +--<br>
> +-- Check syslog unix socket configuration<br>
> +--<br>
> +code = [[<br>
> +local socket = require('socket')<br>
> +local log = require('log')<br>
> +local fio = require('fio')<br>
> +<br>
> +path = fio.pathjoin(fio.cwd(), 'log_unix_socket_test.sock')<br>
> +unix_socket = socket('AF_UNIX', 'SOCK_DGRAM', 0)<br>
> +unix_socket:bind('unix/', path)<br>
> +<br>
> +opt = string.format("syslog:server=<wbr>unix:%s,identity=tarantool", path)<br>
> +local res = 1<br>
> +local buf = 'Started\n'<br>
> +box.cfg{log = opt}<br>
> +<br>
> +-- make sure that socket would not block<br>
> +while unix_socket:readable(1) do<br>
<br>
</div></div>This timeout is way too long. It will increase the test run time by<br>
1 second. Plus 1 second per each socket.readable call below, that is<br>
4 seconds in total.<br>
<br>
We strive to make our tests run faster whenever possible. AFAIU you<br>
don't need to wait for that long. A timeout of say 1 ms (0.001) should<br>
do just fine. Please fix the timeout and re-push the test. No need to<br>
resend the patch - just reply to this email once you're done.<br>
<br></blockquote><div><br></div><div><br></div><div>Done</div><div>Have pushed branch 




<span></span>





<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">OKriw/gh-3487-syslog-conf-dest-1.10</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p>


</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Other than that the patch looks good to me. I'll merge it into the trunk<br>
once you fix the timeouts. Thanks.<br>
<div class="HOEnZb"><div class="h5"><br>
> +    buf = buf .. unix_socket:recv(1000)<br>
> +end<br>
> +<a href="http://log.info" rel="noreferrer" target="_blank">log.info</a>("Test socket syslog destination")<br>
> +while unix_socket:readable(1) do<br>
> +    buf = buf .. unix_socket:recv(1000)<br>
> +    if buf:match('Test socket syslog destination') then res = 0 end<br>
> +end<br>
> +<br>
> +unix_socket:close()                                                         <br>
> +os.remove(path) <br>
> +os.exit(res)<br>
> +]]<br>
> +test:is(run_script(code), 0, "unix socket syslog log configuration")<br>
> +<br>
> +--<br>
> +-- Check syslog remote configuration<br>
> +--<br>
> +code = [[<br>
> +local socket = require('socket')<br>
> +local log = require('log')<br>
> +<br>
> +addr = '127.0.0.1'<br>
> +port = 1000 + math.random(32768)<br>
> +<br>
> +sc = socket('AF_INET', 'SOCK_DGRAM', 'udp')<br>
> +local attempt = 0<br>
> +while attempt < 10 do<br>
> +    if not sc:bind (addr, port) then<br>
> +        port = 1000 + math.random(32768)<br>
> +        attempt = attempt + 1<br>
> +    else<br>
> +        break<br>
> +    end<br>
> +end<br>
> +sc:bind(addr, port)<br>
> +<br>
> +local opt = string.format("syslog:server=%<wbr>s:%u,identity=tarantool", addr, port)<br>
> +local res = 1<br>
> +local buf = 'Started\n'<br>
> +box.cfg{log = opt}<br>
> +<br>
> +-- make sure that socket would not block<br>
> +while sc:readable(1) do<br>
> +    buf = buf .. sc:recv(1000)<br>
> +end<br>
> +<a href="http://log.info" rel="noreferrer" target="_blank">log.info</a>('Test syslog destination')<br>
> +while sc:readable(1) do<br>
> +    buf = buf .. sc:recv(1000)<br>
> +    if buf:match('Test syslog destination') then res = 0 end<br>
> +end<br>
> +<br>
> +sc:close()<br>
> +os.exit(res)<br>
> +]]<br>
> +test:is(run_script(code), 0, "remote syslog log configuration")<br>
> +<br>
>  test:check()<br>
>  os.exit(0)<br>
</div></div></blockquote></div><br></div></div>