tests: terminate subprocess in test-stdio.py in case of exception
If an error happened while reading the output of the subprocess, the pipe / TTY
buffer can fill up and prevent that the subprocess ends. Therefore we should
terminate the subprocess in case of an exception.
--- a/tests/test-stdio.py Tue Jul 07 11:06:37 2020 +0200
+++ b/tests/test-stdio.py Tue Jul 07 12:35:29 2020 +0200
@@ -99,6 +99,9 @@
self.assertEqual(
_readall(stream_receiver, 1024), expected_output
)
+ except: # re-raises
+ proc.terminate()
+ raise
finally:
retcode = proc.wait()
self.assertEqual(retcode, 0)