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

Igor Munkin imun at tarantool.org
Mon Dec 4 12:50:04 MSK 2023


Sergey,

Thanks for your review!

On 04.12.23, Sergey Kaplun wrote:
> Hi, Igor!
> Thanks for the patch!
> LGTM, after fixing Max's comments and my nit below.
> 
> On 28.11.23, Igor Munkin wrote:
> 
> <snipped>
> 
> > ---
> >  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);
> 
> So, we can remove `fflush(stdout);` in the `test_finish()`.

Thanks for noticing. Removed.

================================================================================

diff --git a/test/tarantool-c-tests/test.c b/test/tarantool-c-tests/test.c
index 0a370cdd..c3387e9a 100644
--- a/test/tarantool-c-tests/test.c
+++ b/test/tarantool-c-tests/test.c
@@ -113,7 +113,6 @@ static void test_finish(size_t planned, size_t failed)
        if (failed > 0)
                test_comment("Failed %lu %s out of %lu",
                     failed, t_type, planned);
-       fflush(stdout);
 }
 
 void test_set_skip_reason(const char *reason)

================================================================================

> 
> > +
> >  	test_start_comment(group_name);
> >  
> >  	level++;
> > -- 
> > 2.39.2
> > 
> 
> -- 
> Best regards,
> Sergey Kaplun

-- 
Best regards,
IM


More information about the Tarantool-patches mailing list