Skip to content

Commit

Permalink
test: disable buffering for the C test engine
Browse files Browse the repository at this point in the history
Our testing engine for the tests implemented in C introduced in scope of
the commit a0483bd ("test: introduce
module for C tests") lazily flushes the TAP-formatted report to the
<stdout>. This might lead to a mess in a report e.g. in case when the
particular case forks a child (that inherits its <stdout>) prior to TAP
header is yield to <stdout>. Hence the patch disables buffering for
<stdout> before any part of the TAP-formatted report is printed.

Follows up tarantool/tarantool#7900
  • Loading branch information
igormunkin committed Nov 25, 2023
1 parent fef60a1 commit eda99db
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/tarantool-c-tests/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,12 @@ static int test_run(const struct test_unit *test, size_t test_number,
int _test_run_group(const char *group_name, const struct test_unit tests[],
size_t n_tests, void *test_state)
{
/*
* XXX: Disable buffering for stdout to not mess with the
* output in case there are forking tests in the group.
*/
setvbuf(stdout, NULL, _IONBF, 0);

test_start_comment(group_name);

level++;
Expand Down

0 comments on commit eda99db

Please sign in to comment.