summaryrefslogtreecommitdiff
path: root/uitest/libreoffice
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-07-09 14:46:16 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-07-09 14:47:03 +0200
commit98cbfb087eed0d1defa6ef26385fcf47f95c05fc (patch)
treeb004c1b15a809c0d4b5c3efe821fa4aac84a5549 /uitest/libreoffice
parent7f2d8b1d5994e23a55d83a4604401383a153df18 (diff)
uitest: kill the LibreOffice instance if it ignores terminate request
Change-Id: I47c69878ebaa834eb75208ce8e5c26544e3e62bd
Diffstat (limited to 'uitest/libreoffice')
-rw-r--r--uitest/libreoffice/connection.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/uitest/libreoffice/connection.py b/uitest/libreoffice/connection.py
index 7087ca84bae9..bea7605c7c02 100644
--- a/uitest/libreoffice/connection.py
+++ b/uitest/libreoffice/connection.py
@@ -93,7 +93,22 @@ class OfficeConnection:
pass # ignore
else:
self.soffice.terminate()
- ret = self.soffice.wait()
+
+ DEFAULT_SLEEP = 0.1
+ time_ = 0
+ while time_ < 5:
+ time_ += DEFAULT_SLEEP
+ ret_attr = self.soffice.poll()
+ if ret_attr is not None:
+ break
+ time.sleep(DEFAULT_SLEEP)
+
+ ret = 0
+ if ret_attr is None:
+ ret = 1
+ self.soffice.terminate()
+
+ # ret = self.soffice.wait()
self.xContext = None
self.socket = None
self.soffice = None