Skip to content

Unexpected information in luatest.assert_equals after enabling some compat options #376

@ImeevMA

Description

@ImeevMA

Tarantool: 3.1+
Reproducer:
Create a following test:

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

local g = t.group()

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

g.after_all(function()
    g.server:stop()
end)

g.test_usual_error = function()
    g.server:exec(function()
        t.assert_equals(1, 2)
    end)
end

g.test_verbose_error = function()
    local compat = require('compat')
    compat.box_error_serialize_verbose = 'new'
    compat.box_error_unpack_type_and_code = 'new'
    g.server:exec(function()
        t.assert_equals(1, 2)
    end)
end

Run test using luatest. The result will be:

[001] app-luatest/verbose_error_test.lua                              [ fail ]
[001] Test failed! Output from reject file /tmp/t/rejects/app-luatest/verbose_error.reject:
[001] Tarantool version is 3.2.0-entrypoint-35-g2cfba5eba
[001] TAP version 13
[001] 1..2
[001] # Started on Mon May 20 18:41:32 2024
[001] # Starting group: app-luatest.verbose_error
[001] not ok 1	app-luatest.verbose_error.test_usual_error
[001] #   ...ork/ee/tarantool/test/app-luatest/verbose_error_test.lua:17: expected: 2, actual: 1
[001] #   stack traceback:
[001] #   	...ork/ee/tarantool/test/app-luatest/verbose_error_test.lua:16: in function 'app-luatest.verbose_error.test_usual_error'
[001] #   	...
[001] #   	[C]: in function 'xpcall'
[001] #   artifacts:
[001] #   	master -> /tmp/t/001_app-luatest/artifacts/master-0Nw8NZCj7bCz
[001] not ok 2	app-luatest.verbose_error.test_verbose_error
[001] #   {"status":"fail","class":"LuatestError","message":"...ork/ee/tarantool/test/app-luatest/verbose_error_test.lua:26: expected: 2, actual: 1"} {"code":32,"type":"LuajitError","trace":[{"file":"./src/lua/utils.c","line":679}]}
[001] #   stack traceback:
[001] #   	...ork/ee/tarantool/test/app-luatest/verbose_error_test.lua:25: in function 'app-luatest.verbose_error.test_verbose_error'
[001] #   	...
[001] #   	[C]: in function 'xpcall'
[001] #   artifacts:
[001] #   	master -> /tmp/t/001_app-luatest/artifacts/master-0Nw8NZCj7bCz
[001] # Ran 2 tests in 0.345 seconds, 0 succeeded, 1 failed, 1 errored

The first test gives the expected message. The second gives additional information.

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