From c57191e0c45f9735a33953d6b95d54b0e10c876f Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 7 Aug 2018 09:37:36 +0200 Subject: Try to make test_tdf81457_table_merge_undo deterministic As discussed on #libreoffice-dev: Aug 07 08:48:59 vmiklos, the ASan+UBSan bot fails for a while now in UITest_writer_tests, e.g., ; 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 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 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: Stephan Bergmann --- sw/qa/uitest/writer_tests/tdf79569.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'sw') diff --git a/sw/qa/uitest/writer_tests/tdf79569.py b/sw/qa/uitest/writer_tests/tdf79569.py index ebf752edeb64..631933977ce1 100644 --- a/sw/qa/uitest/writer_tests/tdf79569.py +++ b/sw/qa/uitest/writer_tests/tdf79569.py @@ -20,16 +20,28 @@ class tdf79569(UITestCase): xWriterDoc = self.xUITest.getTopFocusWindow() xWriterEdit = xWriterDoc.getChild("writer_edit") 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") + toolkit_ex.processEventsToIdle() self.xUITest.executeCommand(".uno:GoDown") + toolkit_ex.processEventsToIdle() xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+END"})) + toolkit_ex.processEventsToIdle() self.xUITest.executeCommand(".uno:GoRight") + toolkit_ex.processEventsToIdle() xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+END"})) + toolkit_ex.processEventsToIdle() xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "SHIFT+RIGHT"})) + toolkit_ex.processEventsToIdle() self.xUITest.executeCommand(".uno:MergeCells") + toolkit_ex.processEventsToIdle() self.xUITest.executeCommand(".uno:Undo") + toolkit_ex.processEventsToIdle() self.xUITest.executeCommand(".uno:Redo") + toolkit_ex.processEventsToIdle() self.xUITest.executeCommand(".uno:Undo") + toolkit_ex.processEventsToIdle() self.assertEqual(document.TextTables.getCount(), 1) -- cgit