Skip to content

Second value after nil is not returned from server.exec #350

@Serpentian

Description

@Serpentian

Second value after nil is not returned from server.exec. Caused by e6a2093.

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

g.before_all = function(lg)
    lg.master = server:new({alias = 'master'})
    lg.master:start()
end

g.after_all = function(lg)
    lg.master:drop()
end

g.test_check = function(lg)
    local a, b = lg.master:exec(function()
        return nil, {message = "msg"}
    end)

    t.assert_equals(a, nil)
    t.assert_equals(b.message, "msg")
end
[002] replication-luatest/new_test.lua                                [ fail ]
[002] Test failed! Output from reject file /tmp/t/rejects/replication-luatest/new.reject:
[002] Tarantool version is 3.1.0-entrypoint-26-g57b902887
[002] TAP version 13
[002] 1..1
[002] # Started on Tue Jan 16 16:28:19 2024
[002] # Starting group: replication-luatest.new
[002] not ok 1	replication-luatest.new.test_check
[002] #   ...ming/tnt/tarantool/test/replication-luatest/new_test.lua:20: attempt to index local 'b' (a nil value)
[002] #   stack traceback:
[002] #   	...
[002] #   	[C]: in function 'xpcall'
[002] #   artifacts:
[002] #   	master -> /tmp/t/002_replication-luatest/artifacts/master-tQXcu8z2MNYt
[002] # Ran 1 tests in 0.314 seconds, 0 succeeded, 1 errored
[002] 

Metadata

Metadata

Assignees

No one assigned

    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