qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
Subject: [PULL 03/10] iotests/testrunner: Flush after run_test()
Date: Thu, 12 May 2022 17:33:54 +0200	[thread overview]
Message-ID: <20220512153401.202863-4-kwolf@redhat.com> (raw)
In-Reply-To: <20220512153401.202863-1-kwolf@redhat.com>

From: Hanna Reitz <hreitz@redhat.com>

When stdout is not a terminal, the buffer may not be flushed at each end
of line, so we should flush after each test is done.  This is especially
apparent when run by check-block, in two ways:

First, when running make check-block -jX with X > 1, progress indication
was missing, even though testrunner.py does theoretically print each
test's status once it has been run, even in multi-processing mode.
Flushing after each test restores this progress indication.

Second, sometimes make check-block failed altogether, with an error
message that "too few tests [were] run".  I presume that's because one
worker process in the job pool did not get to flush its stdout before
the main process exited, and so meson did not get to see that worker's
test results.  In any case, by flushing at the end of run_test(), the
problem has disappeared for me.

Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220506134215.10086-1-hreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 tests/qemu-iotests/testrunner.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/qemu-iotests/testrunner.py b/tests/qemu-iotests/testrunner.py
index aae70a8341..10d9e8ef27 100644
--- a/tests/qemu-iotests/testrunner.py
+++ b/tests/qemu-iotests/testrunner.py
@@ -378,6 +378,7 @@ def run_test(self, test: str,
             else:
                 print(res.casenotrun)
 
+        sys.stdout.flush()
         return res
 
     def run_tests(self, tests: List[str], jobs: int = 1) -> bool:
-- 
2.35.3



  parent reply	other threads:[~2022-05-12 15:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-12 15:33 [PULL 00/10] Block layer patches Kevin Wolf
2022-05-12 15:33 ` [PULL 01/10] coroutine: Rename qemu_coroutine_inc/dec_pool_size() Kevin Wolf
2022-05-12 15:33 ` [PULL 02/10] coroutine: Revert to constant batch size Kevin Wolf
2022-05-12 15:33 ` Kevin Wolf [this message]
2022-05-12 15:33 ` [PULL 04/10] tests/qemu-iotests: print intent to run a test in TAP mode Kevin Wolf
2022-05-12 15:33 ` [PULL 05/10] .gitlab-ci.d: export meson testlog.txt as an artifact Kevin Wolf
2022-05-12 15:33 ` [PULL 06/10] hw/block/fdc: Prevent end-of-track overrun (CVE-2021-3507) Kevin Wolf
2022-05-12 15:33 ` [PULL 07/10] tests/qtest/fdc-test: Add a regression test for CVE-2021-3507 Kevin Wolf
2022-05-12 15:33 ` [PULL 08/10] qemu-nbd: Pass max connections to blockdev layer Kevin Wolf
2022-05-12 15:34 ` [PULL 09/10] nbd/server: Allow MULTI_CONN for shared writable exports Kevin Wolf
2022-05-12 15:34 ` [PULL 10/10] qemu-iotests: inline common.config into common.rc Kevin Wolf
2022-05-12 17:02 ` [PULL 00/10] Block layer patches Richard Henderson

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=20220512153401.202863-4-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).