summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2023-02-02 17:36:45 +0100
committerStephan Bergmann <sbergman@redhat.com>2023-02-02 18:31:12 +0000
commit09c3a0aa13e7c4719a73728c2f9ba1f66cea7572 (patch)
tree5a07d0504f8517f5e916c3f963bb7f7373e09c34 /sw
parentfa1f2b7f5c65d66eaa5887acc9da5eb526570b18 (diff)
A better fix for the stale TreeListEntryUIObject issue
...that hits UITest_writer_tests7 UITEST_TEST_NAME=tdf135938.tdf135938.test_tdf135938_cross_reference_update as discussed in the commit message of 51a2e1a3963aae3228c9ddf78d0039c7c063393c "Let executeAction always ProcessEventsToIdle". And while that ProcessEventsToIdle may be a general UITest stability improvement, it turned out that it did not actually fix this test_tdf135938_cross_reference_update issue, which I still kept seeing occasionally with my local ASan/UBSan build. On closer inspection, it was the m_aUpdateTimer timer used by SwChildWinWrapper causing the issue, whose expiration is not forced by the added ProcessEventsToIdle. So lets add a hacky sleep to the Python test code, to hopefully make sure that the timer has expired, and any SvTreeListEntries are stable, by the time the Python code initiates the creation of any TreeListEntryUIObjects that reference those SvTreeListEntries. Change-Id: I9f3c7293d55dffdc910879142d471a299f60a8e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146508 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sw')
-rwxr-xr-xsw/qa/uitest/writer_tests7/tdf135938.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/sw/qa/uitest/writer_tests7/tdf135938.py b/sw/qa/uitest/writer_tests7/tdf135938.py
index 07298ab8d8e1..164c968f55fd 100755
--- a/sw/qa/uitest/writer_tests7/tdf135938.py
+++ b/sw/qa/uitest/writer_tests7/tdf135938.py
@@ -10,12 +10,21 @@
from uitest.framework import UITestCase
from uitest.uihelper.common import get_state_as_dict
from libreoffice.uno.propertyvalue import mkPropertyValues
+import time
class tdf135938(UITestCase):
def test_tdf135938_cross_reference_update(self):
with self.ui_test.create_doc_in_start_center("writer"):
with self.ui_test.execute_modeless_dialog_through_command(".uno:InsertReferenceField", close_button="cancel") as xDialog:
+ # HACK, see the `m_aUpdateTimer.SetTimeout(200)` (to "avoid flickering of buttons")
+ # in the SwChildWinWrapper ctor in sw/source/uibase/fldui/fldwrap.cxx, which can
+ # invalidate the TreeListEntryUIObjects used by the below get_state_as_dict calls
+ # (see 2798430c8a711861fdcdfbf9ac00a0527abd3bfc "Mark the uses of
+ # TreeListEntryUIObject as dubious"); lets double that 200 ms timeout value here to
+ # hopefully be on the safe side:
+ time.sleep(0.4);
+
# Select set reference type
xTreelistType = xDialog.getChild("type-ref")
xTreeEntry = xTreelistType.getChild('0')