Skip to content

test-run expects test output on stdout and not on stderr #383

@ligurio

Description

@ligurio

Steps to reproduce:

  • create a test, that write to stdout, and run it using test-run
  • test-run successfully read test output for this test
  • create test, that write to stderr, and run it using test-run
  • test-run will report "No output during 10 seconds. Will abort after 120 seconds without output." because no output on stdout

Expected result

test-run listen stderr too

Actual result

test-run does not listen stderr, stdout only.

Observation

In Tarantool print() write to stdout and log.info() (and other methods of module log) write to stderr:

[0] ~/sources/MRG/tarantool$ tarantool -e "print('stdout string')" 2> stderr 1> stdout
[0] ~/sources/MRG/tarantool$ cat stderr 
[0] ~/sources/MRG/tarantool$ cat stdout
stdout string
[0] ~/sources/MRG/tarantool$ tarantool -e "require('log').info('stderr string')" 2> stderr 1> stdout
[0] ~/sources/MRG/tarantool$ cat stdout
[0] ~/sources/MRG/tarantool$ cat stderr 
stderr string

Log output

Let's demonstrate it:

[1] ~/sources/MRG/tarantool$ cat test/box-luatest/stderr_test.lua 
local t = require('luatest')
local g = t.group('test-run')
local log = require('log')

g.test_example_1 = function()
    for i = 1, 25 do
        os.execute("sleep 1")
        log.info("one more second")
    end
end

[1] ~/sources/MRG/tarantool$ luatest -c test/box-luatest/stderr_test.lua 
Tarantool version is 2.11.0-rc2-0-g2ae0c94a2
Running with --shuffle group:4769
one more second
one more second
one more second
one more second
one more second
.
<snipped>

Ran 1 tests in 25.011 seconds, 1 succeeded, 0 failed

[0] ~/sources/MRG/tarantool$ ./test/test-run.py --debug --verbose --no-output-timeout=15 box-luatest/stderr_test.lua

<snipped>


======================================================================================
WORKR TEST                                            PARAMS          RESULT
---------------------------------------------------------------------------------
No output during 10 seconds. Will abort after 15 seconds without output. List of workers not reporting the status:
- 001_box-luatest [box-luatest/stderr_test.lua, None] at /tmp/t/001_box-luatest/stderr.result:0
No output during 20 seconds. Will abort after 15 seconds without output. List of workers not reporting the status:
- 001_box-luatest [box-luatest/stderr_test.lua, None] at /tmp/t/001_box-luatest/stderr.result:0
Test hung! Result content mismatch:
[File does not exist: box-luatest/stderr.result]

[Main process] No output from workers. It seems that we hang. Send SIGKILL to workers; exiting...
---------------------------------------------------------------------------------
Top 10 tests by occupied memory (RSS, Mb):
*   19.8 box-luatest/stderr_test.lua                                  

(Tests quicker than 0.1 seconds may be missed.)

---------------------------------------------------------------------------------
Top 10 longest tests (seconds):
---------------------------------------------------------------------------------
* undone: 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions