tarantool / test-run

Tarantool functional testing framework
14 stars 15 forks source link

app+luatest: eliminate stdout buffering and stream mixing problems #394

Closed Totktonada closed 1 year ago

Totktonada commented 1 year ago

The patchset attempts to eliminate unnecessary bufferization and stdout/stderr streams mixing. It should improve observability in case of a failure (#119) and stability for tests that intensively writes to stderr (#392).

Fixes #119 Fixes #392


I test it on small examples like the following:

$ cat test/app-tap/foo.test.lua
#!/usr/bin/env tarantool

local tap = require('tap')

local test = tap.test('foo')

while true do
    test:ok(true, 'foo foo foo')
    io.stderr:write('bar bar bar\n')
    require('fiber').sleep(1)
end
$ cat test/app-luatest/foo_test.lua 
local t = require('luatest')
local g = t.group()

g.test_foo = function()
    while true do
        t.assert_equals(1, 1)
        io.stderr:write('bar bar bar\n')
        require('fiber').sleep(1)
    end
end

And I didn't verify it on the real world tests.

So, please, accept the patches with caution.