[Libreoffice-commits] core.git: uitest/uitest

Markus Mohrhard markus.mohrhard at googlemail.com
Fri Dec 2 03:00:39 UTC 2016


 uitest/uitest/framework.py |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit fa5af9196bf9fbebf194f7fff09b779cb5c3d0fb
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Dec 2 01:19:11 2016 +0100

    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 at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/uitest/uitest/framework.py b/uitest/uitest/framework.py
index be58b12..7d4a78d 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:


More information about the Libreoffice-commits mailing list