Skip to content

Server:grep_log() doesn't work with stopped server #397

@locker

Description

@locker

Consider the following test case:

local t = require('luatest')
local server = require('luatest.server')

local g = t.group()

g.before_each(function(cg)
    cg.server = server.new()
    cg.server:start()
end)

g.after_each(function(cg)
    cg.server:drop()
end)

g.test_grep_log = function(cg)
    server:exec(function() require('log').info('test grep_log') end)
    t.assert(server:grep_log('test grep_log'))
    server:stop()
    t.assert(server:grep_log('test grep_log'))
end

It fails with:

Tarantool version is 3.3.0-entrypoint-169-gd8ebc818c936
Started on Tue Oct 22 14:10:17 2024
    server.test_grep_log_offline ... (0.126s) error
/home/vlad/src/tarantool/luatest/luatest/server.lua:883: net_box is not connected
=========================================================

Tests with errors:
------------------

1) server.test_grep_log_offline
/home/vlad/src/tarantool/luatest/luatest/server.lua:883: net_box is not connected
stack traceback:
        ...
        [C]: in function 'xpcall'
artifacts:
        server -> /tmp/t/artifacts/server-PvqKU6hNIooc
Ran 1 tests in 0.444 seconds, 0 succeeded, 1 errored, 29 not selected

=========================================================
Failed tests:

server.test_grep_log_offline

It's possible to work around this issue by explicitly passing the path to the log file in opts.filename but it's inconvenient. Server:grep_log() should work even if the server is stopped, at least with the default instance.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions