[Tarantool-patches] [PATCH luajit 1/2] test: disable buffering for the C test engine

Maxim Kokryashkin m.kokryashkin at tarantool.org
Sun Dec 3 15:25:17 MSK 2023


Hi, Igor!
Thanks for the patch!
LGTM, except for a few typos in the commit message.
On Tue, Nov 28, 2023 at 02:53:16PM +0000, Igor Munkin wrote:
> Our testing engine for the tests implemented in C introduced in scope of
> the commit a0483bd214f2bbc9d7e5fc95ebc0ae13e8d22bcc ("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
Typo: s/e.g. in case/, e.g.,/
> particular case forks a child (that inherits its <stdout>) prior to TAP
Typo: s/TAP/the TAP/
> header is yield to <stdout>. Hence the patch disables buffering for
Typo: s/is yield/being yielded/
Typo: s/Hence/Hence,/
> <stdout> before any part of the TAP-formatted report is printed.
>
> Follows up tarantool/tarantool#7900
>
> Signed-off-by: Igor Munkin <imun at tarantool.org>
> ---
>  test/tarantool-c-tests/test.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/test/tarantool-c-tests/test.c b/test/tarantool-c-tests/test.c
> index 7907c12a..0a370cdd 100644
> --- a/test/tarantool-c-tests/test.c
> +++ b/test/tarantool-c-tests/test.c
> @@ -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++;
> --
> 2.39.2
>


More information about the Tarantool-patches mailing list