Skip to content

Commit c79715a

Browse files
ligurioBuristan
authored andcommitted
test: fix a problem with Unix socket path
The test `tarantoolgh-2717-no-quit-sigint.test.lua` is failed when length of the path to a socket is exceed max length [1]. The symptom is triggered assertion on the line 267: 'time_quota is violated'. NO_WRAP tarantool> _ = require('console').listen('/home/sergeyb/sources/MRG/tarantool/build/test/app-tap/tarantoolgh-2717-no-quit-sigint.test.lua-workdir/tarantool.soc') --- - error: 'failed to create server unix/:/home/sergeyb/sources/MRG/tarantool/build/test/app-tap/tarantoolgh-2717-no-quit-sigint.test.lua-workdir/tarantool.soc: No buffer space available' ... NO_WRAP The patch changes a path to a socket and put it to the temporary directory. The same problem was fixed for `app-tap/console.test.lua`. Needed for the following patch. 1. https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_un.h.html#tag_13_67_04 NO_CHANGELOG=testing NO_DOC=testing
1 parent dd1329b commit c79715a

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

test/app-tap/console.test.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ local _
1111

1212
-- Suppress console log messages
1313
log.level(4)
14-
local CONSOLE_SOCKET = fio.pathjoin(fio.cwd(), 'tarantool-test-console.sock')
15-
local IPROTO_SOCKET = fio.pathjoin(fio.cwd(), 'tarantool-test-iproto.sock')
16-
os.remove(CONSOLE_SOCKET)
17-
os.remove(IPROTO_SOCKET)
14+
local TMPDIR = fio.tempdir()
15+
local CONSOLE_SOCKET = fio.pathjoin(TMPDIR, 'tarantool-test-console.sock')
16+
local IPROTO_SOCKET = fio.pathjoin(TMPDIR, 'tarantool-test-iproto.sock')
1817

1918
--
2019
local EOL = "\n...\n"
@@ -340,5 +339,6 @@ session_id = nil
340339
triggers_ran = nil
341340
os.remove(CONSOLE_SOCKET)
342341
os.remove(IPROTO_SOCKET)
342+
fio.rmdir(TMPDIR)
343343

344344
os.exit(test:check() and 0 or 1)

test/app-tap/gh-2717-no-quit-sigint.test.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ local log_file = fio.abspath('tarantool.log')
136136
local pid_file = fio.abspath('tarantool.pid')
137137
local xlog_file = fio.abspath('00000000000000000000.xlog')
138138
local snap_file = fio.abspath('00000000000000000000.snap')
139-
local sock = fio.abspath('tarantool.soc')
139+
local tmpdir = fio.tempdir()
140+
local sock = fio.pathjoin(tmpdir, 'tarantool.soc')
140141

141142
local user_grant = ' box.schema.user.grant(\'guest\', \'super\')'
142143
local arg = ' -e \"box.cfg{pid_file=\''
@@ -272,4 +273,6 @@ test:unlike(ph:info().status.state, popen.state.EXITED,
272273
ph:shutdown({stdin = true})
273274
ph:close()
274275

276+
fio.rmdir(tmpdir)
277+
275278
os.exit(test:check() and 0 or 1)

0 commit comments

Comments
 (0)