Skip to contentSkip to conversation

iotests: Fix -makecheck output

PATCH In review Kevin Wolf 2 participants 2 messages Feb 1, 2021

lore
Share & tools
lore

Kevin Wolf

author
#0 lore raw

PATCH 1/1 iotests: Fix -makecheck output

For -makecheck, the old 'check' implementation skipped the output when starting a test. It only had the condensed output at the end of a test.

testrunner.py prints the normal output when starting a test even for -makecheck. This output contains '\r' at the end so that it can be overwritten with the result at the end of the test. However, for -makecheck this is shorter output in a different format, so effectively we end up with garbled output that mixes both output forms.

Revert to the old behaviour of only printing a message after the test had completed in -makecheck mode.

Fixes d74c754c924ca34e90b7c96ce2f5609d82c0e628
---
 tests/qemu-iotests/testrunner.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
tests/qemu-iotests/testrunner.py +4 -2
index 25754e9a09..1fc61fcaa3 100644
@@ -301,8 +301,10 @@ class TestRunner(ContextManager['TestRunner']):
         last_el = self.last_elapsed.get(test)
         start = datetime.datetime.now().strftime('%H:%M:%S')
 
-        self.test_print_one_line(test=test, starttime=start, lasttime=last_el,
-                                 end='\r', test_field_width=test_field_width)
+        if not self.makecheck:
+            self.test_print_one_line(test=test, starttime=start,
+                                     lasttime=last_el, end='\r',
+                                     test_field_width=test_field_width)
 
         res = self.do_run_test(test)
 
Signature · 1 line
2.29.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 26 lines · Kevin Wolf

For -makecheck, the old 'check' implementation skipped the output when starting a test. It only had the condensed output at the end of a test.

testrunner.py prints the normal output when starting a test even for -makecheck. This output contains '\r' at the end so that it can be overwritten with the result at the end of the test. However, for -makecheck this is shorter output in a different format, so effectively we end up with garbled output that mixes both output forms.

Revert to the old behaviour of only printing a message after the test had completed in -makecheck mode.

Fixes d74c754c924ca34e90b7c96ce2f5609d82c0e628
---
  tests/qemu-iotests/testrunner.py | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
tests/qemu-iotests/testrunner.py +0 -0
index 25754e9a09..1fc61fcaa3 100644
@@ -301,8 +301,10 @@ class TestRunner(ContextManager['TestRunner']):
          last_el = self.last_elapsed.get(test)
          start = datetime.datetime.now().strftime('%H:%M:%S')

tests/qemu-iotests/testrunner.py class TestRunner(ContextManager['TestRunner']): · line 310

Quoted 10 lines
tests/qemu-iotests/testrunner.py +4 -2
 
-        self.test_print_one_line(test=test, starttime=start, lasttime=last_el,
-                                 end='\r', test_field_width=test_field_width)
+        if not self.makecheck:
+            self.test_print_one_line(test=test, starttime=start,
+                                     lasttime=last_el, end='\r',
+                                     test_field_width=test_field_width)
 
          res = self.do_run_test(test)
 
Signature · 2 lines
Best regards,
Vladimir