Skip to content

Commit ae8e3d2

Browse files
ImeevMAylobankov
authored andcommitted
server: change error message for unix socket path
This patch changes the error message when the Unix socket path length exceeds a certain limit. Follow-up #341
1 parent c1b2622 commit ae8e3d2

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- Added `assert_error_covers`.
99
- Add more logs (gh-326).
1010
- Add `justrun` helper as a tarantool runner and output catcher (gh-365).
11+
- Changed error message for too long Unix domain socket paths (gh-341).
1112

1213
## 1.0.1
1314

luatest/server.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,9 @@ function Server:initialize()
164164
local max_unix_socket_path = {linux = 107, other = 103}
165165
local system = os.execute('[ $(uname) = Linux ]') == 0 and 'linux' or 'other'
166166
if parsed_net_box_uri.unix:len() > max_unix_socket_path[system] then
167-
error(('Net box URI must be <= max Unix domain socket path length (%d chars)')
168-
:format(max_unix_socket_path[system]))
167+
error(('Unix domain socket path cannot be longer than %d chars. ' ..
168+
'Current path is: %s'):format(max_unix_socket_path[system],
169+
parsed_net_box_uri.unix))
169170
end
170171
end
171172
if type(self.net_box_uri) == 'table' then

test/server_test.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,8 @@ g.test_max_unix_socket_path_exceeded = function()
286286

287287
t.assert_equals(string.len(net_box_uri), max_unix_socket_path[system] + 1)
288288
t.assert_error_msg_contains(
289-
string.format('Net box URI must be <= max Unix domain socket path length (%s chars)',
290-
max_unix_socket_path[system]),
289+
string.format('Unix domain socket path cannot be longer than %d ' ..
290+
'chars. Current path is:', max_unix_socket_path[system]),
291291
Server.new, Server, {
292292
command = command,
293293
workdir = workdir,

0 commit comments

Comments
 (0)