Skip to content

luatest hangs if tests perform too many checks without yielding execution #416

Closed
@locker

Description

@locker

Add the following test to test/bad_test.lua:

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

for i = 1, 100 do
    g['test_' .. i] = function()
        for j = 1, 100 do
            t.assert_equals(i, i)
            t.assert_equals(j, j)
        end
    end
end

Run it with disabled capturing (-c):

bin/luatest -c -v test/bad_test.lua

It hangs:

$ bin/luatest -c -v test/bad_test.lua
Tarantool version is 3.4.0-entrypoint-227-gf1ccb2f142f6
Started on Fri Apr  4 17:56:30 2025
luatest | 2025-04-04 17:56:30.081 [412780] main/104/luatest/luatest.log runner.lua:306 I> Bootstrap finished: 1 test(s), 0 group(s)
    bad.test_1 ...
    bad.test_1 ... (0.005s) Ok
    bad.test_69 ...
    bad.test_69 ... (0.004s) Ok
    bad.test_7 ...

Notes:

  • If capturing is enabled, the test passes successfully.
  • If logs are written to the unified log file (-l <path>), the test passes as well.
  • The issue was reproduced at commit 6c5c8b7. At the previous commit (2f16ac7), the test passes.

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