diff options
author | Hanna Reitz <hreitz@redhat.com> | 2022-05-06 15:42:15 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2022-05-12 12:25:18 +0200 |
commit | 22d92e71c77c8690995315c9ef5a1136c6300047 (patch) | |
tree | f6b9954722993b70685997382fe60418327f45cf /tests/qemu-iotests | |
parent | 9ec7a59b5aad4b736871c378d30f5ef5ec51cb52 (diff) |
iotests/testrunner: Flush after run_test()
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>
Diffstat (limited to 'tests/qemu-iotests')
-rw-r--r-- | tests/qemu-iotests/testrunner.py | 1 |
1 files changed, 1 insertions, 0 deletions
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 @@ class TestRunner(ContextManager['TestRunner']): else: print(res.casenotrun) + sys.stdout.flush() return res def run_tests(self, tests: List[str], jobs: int = 1) -> bool: |