dbaccess/qa/uitest/edit_field/tdf75509.py | 4 ++++ dbaccess/qa/uitest/query/tdf99619_create_join_undo_redo.py | 4 ++++ 2 files changed, 8 insertions(+)
New commits: commit 9b004694bbcd36d2c3bf4fc8e15a459fa95f4b58 Author: Neil Roberts <[email protected]> AuthorDate: Sun Nov 23 00:52:19 2025 +0100 Commit: Neil Roberts <[email protected]> CommitDate: Sun Nov 23 08:09:42 2025 +0100 dbaccess/uitest: Wait for idle after selecting view mode The .uno:DBViewTables and .uno:DBViewQueries commands are executed asynchronously by posting an event to the main thread from OApplicationController. This creates a race condition for the test where the following call to .uno:SelectAll silently fails if the event is not processed before the command is dispatched. After that the attempt to open a new subcomponent fails, the OnLoad event is never sent and the test gets stuck in an infinite loop until the kill-wrapper kills it. This happens for example in the following build log: https://ci.libreoffice.org/job/gerrit_linux_clang_dbgutil/193243/console I think I can artificially reproduce the problem locally by adding a sleep in OApplicationController::OnSelectContainer and at least in that case this patch appears to fix it. It just makes the tests wait until the main thread is idle after issuing the commands to switch the view. Change-Id: If8698114c30cf4219310a9c1b2a2bb365debea8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194376 Reviewed-by: Neil Roberts <[email protected]> Tested-by: Jenkins diff --git a/dbaccess/qa/uitest/edit_field/tdf75509.py b/dbaccess/qa/uitest/edit_field/tdf75509.py index 3fc1957ff07c..e221f539cb43 100644 --- a/dbaccess/qa/uitest/edit_field/tdf75509.py +++ b/dbaccess/qa/uitest/edit_field/tdf75509.py @@ -23,6 +23,10 @@ class tdf75509(UITestCase): xDbWindow = self.xUITest.getTopFocusWindow() self.xUITest.executeCommand(".uno:DBViewTables") + # The above command is run asynchronously via an event on the main thread so we need to + # wait until it is dispatched before executing the next command + xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit') + xToolkit.waitUntilAllIdlesDispatched() # We just want to select the single table in the list of tables but it seems difficult # to get access to the treeview window for it because there are multiple treeviews in a diff --git a/dbaccess/qa/uitest/query/tdf99619_create_join_undo_redo.py b/dbaccess/qa/uitest/query/tdf99619_create_join_undo_redo.py index eccaf8162c71..5aa55dc7557d 100644 --- a/dbaccess/qa/uitest/query/tdf99619_create_join_undo_redo.py +++ b/dbaccess/qa/uitest/query/tdf99619_create_join_undo_redo.py @@ -24,6 +24,10 @@ class tdf99619(UITestCase): xDbWindow = self.xUITest.getTopFocusWindow() self.xUITest.executeCommand(".uno:DBViewQueries") + # The above command is run asynchronously via an event on the main thread so we need to + # wait until it is dispatched before executing the next command + xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit') + xToolkit.waitUntilAllIdlesDispatched() # We just want to select the single query in the list of queries but it seems difficult # to get access to the treeview window for it because there are multiple treeviews in a
