Skip to content
Snippets Groups Projects
Commit 3800e36d authored by Olga Arkhangelskaia's avatar Olga Arkhangelskaia Committed by Vladimir Davydov
Browse files

test: add test to check log_nonblock mode

We should test log_nonblock mode. In some cases the loss of this flag
lead to tarantool hanging forever. This tests checks such possibility.

Follow-up #3615
parent 587bfc7e
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@ local socket = require('socket')
local fio = require('fio')
local uuid = require('uuid')
local msgpack = require('msgpack')
test:plan(95)
test:plan(96)
--------------------------------------------------------------------------------
-- Invalid values
......@@ -530,5 +530,28 @@ os.exit(res)
]]
test:is(run_script(code), 0, "remote syslog log configuration")
--
-- gh-3615: check that log_nonblock is not lost
--
code=[[
local socket = require('socket')
local log = require('log')
local fio = require('fio')
path = fio.pathjoin(fio.cwd(), 'log_unix_socket_test.sock')
unix_socket = socket('AF_UNIX', 'SOCK_DGRAM', 0)
unix_socket:bind('unix/', path)
opt = string.format("syslog:server=unix:%s,identity=tarantool", path)
box.cfg{log = opt, log_nonblock=true}
-- Try to fill buffer
for i = 1, 1000 do log.info(string.rep('x', 1000)) end
unix_socket:close()
os.remove(path)
os.exit(0)
]]
test:is(run_script(code), 0, "log_nonblock")
test:check()
os.exit(0)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment