summaryrefslogtreecommitdiff
path: root/test/monkeyfarmer.py
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2019-06-27 13:16:51 +0100
committerVincent Sanders <vince@kyllikki.org>2019-06-27 13:16:51 +0100
commit4368c4c04268f6528eb8bcc1ff83ee679f6f13bf (patch)
treea96f416707568fddcdf5fb15704761558594ebd9 /test/monkeyfarmer.py
parenta57940a468e7abd65cc2d69d3f8a167b0f4e4dfc (diff)
downloadnetsurf-4368c4c04268f6528eb8bcc1ff83ee679f6f13bf.tar.gz
netsurf-4368c4c04268f6528eb8bcc1ff83ee679f6f13bf.tar.bz2
attempt to make monkeyfarmer process exit detection more reliable
Diffstat (limited to 'test/monkeyfarmer.py')
-rw-r--r--test/monkeyfarmer.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/monkeyfarmer.py b/test/monkeyfarmer.py
index b86372136..94943431b 100644
--- a/test/monkeyfarmer.py
+++ b/test/monkeyfarmer.py
@@ -64,18 +64,18 @@ class MonkeyFarmer(asyncore.dispatcher):
def handle_close(self):
# the pipe to the monkey process has closed
- # ensure the child process is finished and report the exit
self.close()
- if self.monkey.poll() is None:
- self.monkey.terminate()
- self.monkey.wait()
- self.lines.insert(0, "GENERIC EXIT {}".format(self.monkey.returncode).encode('utf-8'))
def handle_read(self):
got = self.recv(8192)
if not got:
self.deadmonkey = True
+ # ensure the child process is finished and report the exit
+ if self.monkey.poll() is None:
+ self.monkey.terminate()
+ self.monkey.wait()
+ self.lines.insert(0, "GENERIC EXIT {}".format(self.monkey.returncode).encode('utf-8'))
return
self.incoming += got
if b"\n" in self.incoming: