From 22d92e71c77c8690995315c9ef5a1136c6300047 Mon Sep 17 00:00:00 2001 From: Hanna Reitz Date: Fri, 6 May 2022 15:42:15 +0200 Subject: 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 Message-Id: <20220506134215.10086-1-hreitz@redhat.com> Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- tests/qemu-iotests/testrunner.py | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/qemu-iotests/testrunner.py') 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: -- cgit 1.4.1 From 5e781c700a6ebf089cb01eb4f612479bfcfe186d Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrangé" Date: Mon, 9 May 2022 13:41:33 +0100 Subject: tests/qemu-iotests: print intent to run a test in TAP mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When running I/O tests using TAP output mode, we get a single TAP test with a sub-test reported for each I/O test that is run. The output looks something like this: 1..123 ok qcow2 011 ok qcow2 012 ok qcow2 013 ok qcow2 217 ... If everything runs or fails normally this is fine, but periodically we have been seeing the test harness abort early before all 123 tests have been run, just leaving a fairly useless message like TAP parsing error: Too few tests run (expected 123, got 107) we have no idea which tests were running at the time the test harness abruptly exited. This change causes us to print a message about our intent to run each test, so we have a record of what is active at the time the harness exits abnormally. 1..123 # running qcow2 011 ok qcow2 011 # running qcow2 012 ok qcow2 012 # running qcow2 013 ok qcow2 013 # running qcow2 217 ok qcow2 217 ... Signed-off-by: Daniel P. Berrangé Message-Id: <20220509124134.867431-2-berrange@redhat.com> Reviewed-by: Thomas Huth Signed-off-by: Kevin Wolf --- tests/qemu-iotests/testrunner.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/qemu-iotests/testrunner.py') diff --git a/tests/qemu-iotests/testrunner.py b/tests/qemu-iotests/testrunner.py index 10d9e8ef27..5a771da86e 100644 --- a/tests/qemu-iotests/testrunner.py +++ b/tests/qemu-iotests/testrunner.py @@ -361,6 +361,9 @@ class TestRunner(ContextManager['TestRunner']): starttime=start, lasttime=last_el, end = '\n' if mp else '\r') + else: + testname = os.path.basename(test) + print(f'# running {self.env.imgfmt} {testname}') res = self.do_run_test(test, mp) -- cgit 1.4.1