Mercurial > hg-stable
changeset 45070:9172fd511999
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.
author | Manuel Jacob <me@manueljacob.de> |
---|---|
date | Tue, 07 Jul 2020 12:35:29 +0200 |
parents | 8cd18aba5e6c |
children | bc05c13e246f |
files | tests/test-stdio.py |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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)