Kaydet (Commit) c57191e0 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Try to make test_tdf81457_table_merge_undo deterministic

As discussed on #libreoffice-dev:

  Aug 07 08:48:59 <sberg> vmiklos, the ASan+UBSan bot fails for a while now in
    UITest_writer_tests, e.g., <https://ci.libreoffice.org//job/lo_ubsan/995/
    consoleFull#-14523843999567f988-cbcf-4519-af05-6000b834f13f>; a bit unclear
    when it started, as it might initially have been hidden by another
    (meanwhile fixed) issue that stopped the build before reaching this test; I
    can't reproduce it with my local ASan+UBSan build; I guess something timing
    dependent, the test code is at sw/qa/uitest/writer_tests/tdf79569.py:32
    (i.e., the second .uno:Undo and hits the assert at
    sw/source/core/layout/findfrm.cxx:1702 (search for it further up in the
    log), after preceding warnings like "Didn't find wished box"; any idea
    whether anything there could be timing dependent?
  Aug 07 09:09:48 <vmiklos> sberg: i'm not sure if any of that is executed
    synchronously, actually. all of these .uno:Foo commands are dispatched async
    IIRC
  Aug 07 09:13:03 <vmiklos> sberg: the easiest i could think of (to find out if
    my assumption is correct) would be to insert the pyuno equivalent of
    Scheduler::ProcessEventsToIdle() after the dispatches and see if that helps.
    (we should have an UNO interface + service that exposes that)

Not sure whether all of the executeCommand/executeAction would need to be
followed by processEventsToIdle, but probably doesn't hurt to be conservative
there (except maybe for increased run time?).

Change-Id: Iac64330def636a7b7db958e83feae9ce66d0677b
Reviewed-on: https://gerrit.libreoffice.org/58663
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst fe5afeda
...@@ -20,16 +20,28 @@ class tdf79569(UITestCase): ...@@ -20,16 +20,28 @@ class tdf79569(UITestCase):
xWriterDoc = self.xUITest.getTopFocusWindow() xWriterDoc = self.xUITest.getTopFocusWindow()
xWriterEdit = xWriterDoc.getChild("writer_edit") xWriterEdit = xWriterDoc.getChild("writer_edit")
document = self.ui_test.get_component() document = self.ui_test.get_component()
toolkit_ex = self.xContext.ServiceManager.createInstanceWithContext(
"com.sun.star.awt.Toolkit", self.xContext) # supports css.awt.XToolkitExperimental
self.xUITest.executeCommand(".uno:GoDown") self.xUITest.executeCommand(".uno:GoDown")
toolkit_ex.processEventsToIdle()
self.xUITest.executeCommand(".uno:GoDown") self.xUITest.executeCommand(".uno:GoDown")
toolkit_ex.processEventsToIdle()
xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+END"})) xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+END"}))
toolkit_ex.processEventsToIdle()
self.xUITest.executeCommand(".uno:GoRight") self.xUITest.executeCommand(".uno:GoRight")
toolkit_ex.processEventsToIdle()
xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+END"})) xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+END"}))
toolkit_ex.processEventsToIdle()
xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "SHIFT+RIGHT"})) xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "SHIFT+RIGHT"}))
toolkit_ex.processEventsToIdle()
self.xUITest.executeCommand(".uno:MergeCells") self.xUITest.executeCommand(".uno:MergeCells")
toolkit_ex.processEventsToIdle()
self.xUITest.executeCommand(".uno:Undo") self.xUITest.executeCommand(".uno:Undo")
toolkit_ex.processEventsToIdle()
self.xUITest.executeCommand(".uno:Redo") self.xUITest.executeCommand(".uno:Redo")
toolkit_ex.processEventsToIdle()
self.xUITest.executeCommand(".uno:Undo") self.xUITest.executeCommand(".uno:Undo")
toolkit_ex.processEventsToIdle()
self.assertEqual(document.TextTables.getCount(), 1) self.assertEqual(document.TextTables.getCount(), 1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment