diff options
-rw-r--r-- | uitest/libreoffice/connection.py | 17 |
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 |