[Libreoffice-commits] core.git: sc/qa

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Thu Jun 24 12:19:54 UTC 2021


 sc/qa/uitest/calc_tests/calcSheetDelete.py |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit 4feb8e557815151601228bdf0dde01099534b3db
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Thu Jun 24 10:56:30 2021 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Thu Jun 24 14:18:59 2021 +0200

    Fix presumed race between executeAction and following asserts in UITest
    
    ...where I had observed UITest_calc_tests failing at least once with
    
    > ======================================================================
    > FAIL: test_delete_more_sheets_at_once (calcSheetDelete.calcSheetDelete)
    > ----------------------------------------------------------------------
    > Traceback (most recent call last):
    >   File "sc/qa/uitest/calc_tests/calcSheetDelete.py", line 107, in test_delete_more_sheets_at_once
    >     self.assertEqual(document.Sheets.getCount(), nrSheets)
    > AssertionError: 7 != 1
    >
    > ======================================================================
    > FAIL: test_tdf105105_delete_lots_of_sheets_at_once (calcSheetDelete.calcSheetDelete)
    > ----------------------------------------------------------------------
    > Traceback (most recent call last):
    >   File "sc/qa/uitest/calc_tests/calcSheetDelete.py", line 130, in test_tdf105105_delete_lots_of_sheets_at_once
    >     self.assertEqual(document.Sheets.getCount(), nrSheets + 100)
    > AssertionError: 100 != 101
    >
    > ======================================================================
    > FAIL: test_tdf114228_insert_and_delete_sheet (calcSheetDelete.calcSheetDelete)
    > ----------------------------------------------------------------------
    > Traceback (most recent call last):
    >   File "sc/qa/uitest/calc_tests/calcSheetDelete.py", line 37, in test_tdf114228_insert_and_delete_sheet
    >     self.assertEqual(document.Sheets.getCount(), nrSheets)
    > AssertionError: 2 != 1
    >
    > ======================================================================
    > FAIL: test_tdf43078_insert_and_delete_sheet_insert_text (calcSheetDelete.calcSheetDelete)
    > ----------------------------------------------------------------------
    > Traceback (most recent call last):
    >   File "sc/qa/uitest/calc_tests/calcSheetDelete.py", line 62, in test_tdf43078_insert_and_delete_sheet_insert_text
    >     self.assertEqual(document.Sheets.getCount(), nrSheets + 2)
    > AssertionError: 2 != 3
    
    Change-Id: Id757571c153b3305644f8e4a099c4dc31bca3c52
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117767
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/sc/qa/uitest/calc_tests/calcSheetDelete.py b/sc/qa/uitest/calc_tests/calcSheetDelete.py
index ae8867c6f97c..b237003b648d 100644
--- a/sc/qa/uitest/calc_tests/calcSheetDelete.py
+++ b/sc/qa/uitest/calc_tests/calcSheetDelete.py
@@ -33,6 +33,8 @@ class calcSheetDelete(UITestCase):
         xDialog = self.xUITest.getTopFocusWindow()
         xOKButton = xDialog.getChild("yes")
         xOKButton.executeAction("CLICK", tuple())
+        xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit')
+        xToolkit.processEventsToIdle()
 
         self.assertEqual(document.Sheets.getCount(), nrSheets)
         self.xUITest.executeCommand(".uno:Undo")
@@ -58,6 +60,8 @@ class calcSheetDelete(UITestCase):
         xDialog = self.xUITest.getTopFocusWindow()
         xOKButton = xDialog.getChild("ok")
         xOKButton.executeAction("CLICK", tuple())
+        xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit')
+        xToolkit.processEventsToIdle()
 
         self.assertEqual(document.Sheets.getCount(), nrSheets + 2)
         xCalcDoc = self.xUITest.getTopFocusWindow()
@@ -104,6 +108,8 @@ class calcSheetDelete(UITestCase):
         xOKButton = xDialog.getChild("yes")
         xOKButton.executeAction("CLICK", tuple())
 
+        xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit')
+        xToolkit.processEventsToIdle()
         self.assertEqual(document.Sheets.getCount(), nrSheets)
         self.xUITest.executeCommand(".uno:Undo")
         self.assertEqual(document.Sheets.getCount(), nrSheets + 6)
@@ -127,6 +133,8 @@ class calcSheetDelete(UITestCase):
             xOKButton = xDialog.getChild("ok")
             xOKButton.executeAction("CLICK", tuple())
             i = i + 1
+        xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit')
+        xToolkit.processEventsToIdle()
         self.assertEqual(document.Sheets.getCount(), nrSheets + 100)
 
         i = 0


More information about the Libreoffice-commits mailing list