public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v5 0/4] Run tests in CI
Date: Wed, 14 Jul 2021 17:00:08 +0200	[thread overview]
Message-ID: <YO77+MmmxwMewgnQ@yuki> (raw)
In-Reply-To: <YO70PiTdyxzTw0k2@pevik>

Hi!
> tested:
> https://github.com/pevik/ltp/actions/runs/1030551185
> 
> One thing which bothers me is mangled output of several tests together:
> https://github.com/pevik/ltp/runs/3067600696?check_suite_focus=true#step:11:554
> 
> runtest TINFO: * tst_res_hexd
> /__w/ltp/ltp/lib/tst_test.c:1344: TINFO: Timeout per run is 0h 05m 00s
> /__w/ltp/ltp/lib/newlib_tests/tst_res_hexd.c:13: TPASS: dump1
> /__w/ltp/ltp/lib/newlib_tests/tst_res_hexd.c:13: TPASS: 48 65 6c 6c 6f 20 66 72 6f 6d 20 74 73 74 5f 72
> /__w/ltp/ltp/lib/newlib_tests/tst_res_hexd.c:13: TPASS: 65 73 5f 68 65 78 64 00
> 
> runtest TINFO: * tst_strstatus
> /__w/ltp/ltp/lib/tst_test.c:1344: TINFO: Timeout per run is 0h 05m 00s
> 
> Summary:
> passed   35
> failed   0
> broken   0
> skipped  0
> warnings 0
> 
> Summary:
> passed   1
> failed   0
> broken   0
> skipped  0
> warnings 0

That is indeed strange, you are running these in a loop, the buffers
should have been flushed once controll returns back to the shell from
the test.

I guess that this is a combination of:

* The stdout and stderr are block buffered by the gitlab CI and flushed
  at different times

* The summary is written into stdout in contrast with the message
  so we end up with summary printed later than the rest that goes into
  stderr

I guess this should fix it:

diff --git a/lib/tst_test.c b/lib/tst_test.c
index f4d9f8e3b..084a83c9e 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -734,12 +734,12 @@ static void do_exit(int ret)
                if (results->broken)
                        ret |= TBROK;

-               printf("\nSummary:\n");
-               printf("passed   %d\n", results->passed);
-               printf("failed   %d\n", results->failed);
-               printf("broken   %d\n", results->broken);
-               printf("skipped  %d\n", results->skipped);
-               printf("warnings %d\n", results->warnings);
+               fprintf(stderr, "\nSummary:\n");
+               fprintf(stderr, "passed   %d\n", results->passed);
+               fprintf(stderr, "failed   %d\n", results->failed);
+               fprintf(stderr, "broken   %d\n", results->broken);
+               fprintf(stderr, "skipped  %d\n", results->skipped);
+               fprintf(stderr, "warnings %d\n", results->warnings);
        }

        do_cleanup();

-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2021-07-14 15:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-14 14:19 [LTP] [PATCH v5 0/4] Run tests in CI Petr Vorel
2021-07-14 14:19 ` [LTP] [PATCH v5 1/4] lib: Add script for running tests Petr Vorel
2021-07-14 14:19 ` [LTP] [PATCH v5 2/4] make: Add make test{, -c, -shell} targets Petr Vorel
2021-07-14 14:20 ` [LTP] [PATCH v5 3/4] build.sh: Add support for make test Petr Vorel
2021-07-14 14:20 ` [LTP] [PATCH v5 4/4] CI: Run also " Petr Vorel
2021-07-14 14:27 ` [LTP] [PATCH v5 0/4] Run tests in CI Petr Vorel
2021-07-14 15:00   ` Cyril Hrubis [this message]
2021-07-14 16:43     ` Petr Vorel
2021-07-15  7:38       ` Petr Vorel
2021-07-15  7:48         ` Petr Vorel
2021-07-15  8:51         ` Cyril Hrubis
2021-07-15  9:22           ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YO77+MmmxwMewgnQ@yuki \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox