diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2020-01-24 19:02:23 +0100 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-01-25 20:03:15 +0100 |
commit | 150b67b57bd25ba9c8ec9c28c7aed3cc0b557bfd (patch) | |
tree | 676c2773177900230dabc27a00c7753402dc2e65 /uitest | |
parent | 37b20089669e5d6f20db863ed770647ba8b1bd37 (diff) |
UITest: Actually time-out the wait
Without that, if XDesktop::terminate() fails (e.g., because an assert in
a test was false while a modal dialog was open, which left the dialog
open, and so TerminationVetoException was thrown in XDesktop::terminate()
by a listener), the wait never ends, and the assertion message gets lost
when buildbot terminates the build, as happened in
https://ci.libreoffice.org/job/gerrit_linux_clang_dbgutil/51496/console.
The timeout only available since python 3.3.
The soffice process is not terminated in this case; hopefully it will be
terminated when build cleanup will occur.
Change-Id: I924775d0e58619d1fbd603e80ed1f8d047c91145
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87362
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/libreoffice/connection.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/uitest/libreoffice/connection.py b/uitest/libreoffice/connection.py index cb3ae1a0128e..3dbae4cca355 100644 --- a/uitest/libreoffice/connection.py +++ b/uitest/libreoffice/connection.py @@ -9,6 +9,7 @@ import subprocess import time import uuid import os +import sys try: import pyuno @@ -130,10 +131,17 @@ class OfficeConnection: else: self.soffice.terminate() - ret = self.soffice.wait() - self.xContext = None - self.socket = None - self.soffice = None + + try: + if sys.version_info >= (3,3): + ret = self.soffice.wait(30) # will throw when timed out + else: + ret = self.soffice.wait() # no timeout in python that old + finally: + self.xContext = None + self.socket = None + self.soffice = None + if ret != 0: raise Exception("Exit status indicates failure: " + str(ret)) |