summaryrefslogtreecommitdiff
path: root/uitest
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-12-02 01:19:11 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-12-02 03:00:09 +0000
commitfa5af9196bf9fbebf194f7fff09b779cb5c3d0fb (patch)
treeef2551ea1d2d3c0b2f9f1f6c72ab545bac3912e9 /uitest
parent50962f29295e72bce0c45aef8fb3df9a291f22c0 (diff)
uitest: prevent deadlock when the test fails
when the test fails it was possible that the terminate call was trying to close all the open windows which could show the query close dialog. The new approach is to close all remaining documents in tearDown. Change-Id: I0078eaf1995c3085af0bbbb072f636b316003c02 Reviewed-on: https://gerrit.libreoffice.org/31515 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'uitest')
-rw-r--r--uitest/uitest/framework.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/uitest/uitest/framework.py b/uitest/uitest/framework.py
index be58b129bfa5..7d4a78d4419b 100644
--- a/uitest/uitest/framework.py
+++ b/uitest/uitest/framework.py
@@ -31,6 +31,15 @@ class UITestCase(unittest.TestCase):
def tearDown(self):
t = time.time() - self.startTime
print("Execution time for %s: %.3f" % (self.id(), t))
+ if self.xContext is not None:
+ desktop = self.ui_test.get_desktop()
+ components = desktop.getComponents()
+ for component in components:
+ try:
+ component.close(False)
+ except Exception as e:
+ print(e)
+
self.connection.tearDown()
# vim: set shiftwidth=4 softtabstop=4 expandtab: