[Patchew-devel] [PATCH] testing: print "OUTPUT END" after killing the test script

Paolo Bonzini posted 1 patch 40 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/patchew next tags/patchew/20190113140548.14442-1-pbonzini@redhat.com
patchew-cli | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

[Patchew-devel] [PATCH] testing: print "OUTPUT END" after killing the test script

Posted by Paolo Bonzini 40 weeks ago
Otherwise, there is a small window where OUTPUT END has already been
printed but the script is still running, and the emails (which look
for OUTPUT END) may lose some content.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 patchew-cli | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/patchew-cli b/patchew-cli
index 8012955..a66edb9 100755
--- a/patchew-cli
+++ b/patchew-cli
@@ -548,8 +548,6 @@ class TesterCommand(SubCommand):
                 if rc != None:
                     break
                 time.sleep(0.1)
-            logf.write("=== OUTPUT END ===\n")
-            logf.write("\n")
             if rc == None:
                 try:
                     tp.terminate()
@@ -560,8 +558,11 @@ class TesterCommand(SubCommand):
                     tp.wait()
                 except Exception as e:
                     traceback.print_exc(file=logf)
-                logf.write("Abort: command timeout (>%d seconds)" % timeout)
                 is_timeout = True
+            logf.write("=== OUTPUT END ===\n")
+            logf.write("\n")
+            if is_timeout:
+                logf.write("Abort: command timeout (>%d seconds)" % timeout)
             else:
                 logf.write("Test command exited with code: %d" % rc)
             logf.flush()
-- 
2.20.1

_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://www.redhat.com/mailman/listinfo/patchew-devel