From e7da569d1287b53ce872d9bc75e88e8c78e3af02 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 30 Nov 2026 12:06:17 +0100 Subject: test: survive Qt 6.12 and QtWebEngine 6.140 QtWebEngine 6.140's in-process GPU thread raises SIGTRAP under the offscreen platform and takes test_mainwindow down with it. Offscreen has no GPU to offer, so ctest now passes --disable-gpu alongside it. undoMovesTheMessageBack triggered Undo as soon as the file reached the trash, but the worker moves the file before its confirmation crosses back and pushes the MoveCommand. Under Qt 6.12 that race lost every time and Undo ran on an empty stack. Wait for canUndo() as well. Co-Authored-By: Claude Opus 5.5 --- tests/CMakeLists.txt | 4 +++- tests/test_mainwindow.cpp | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2b4b42d..0b32553 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -29,7 +29,9 @@ function(add_qtmaildir_test name) target_link_libraries(test_${name} PRIVATE qtmaildir_lib Qt6::Test) add_test(NAME ${name} COMMAND test_${name}) set_tests_properties(${name} PROPERTIES - ENVIRONMENT "QT_QPA_PLATFORM=offscreen") + # --disable-gpu: QtWebEngine 6.140's in-process GPU thread hits a + # SIGTRAP under offscreen, which has no GPU to offer anyway. + ENVIRONMENT "QT_QPA_PLATFORM=offscreen;QTWEBENGINE_CHROMIUM_FLAGS=--disable-gpu") endfunction() add_qtmaildir_test(keymap) diff --git a/tests/test_mainwindow.cpp b/tests/test_mainwindow.cpp index 5eed336..9fc8439 100644 --- a/tests/test_mainwindow.cpp +++ b/tests/test_mainwindow.cpp @@ -13736,6 +13736,11 @@ void TestMainWindow::undoMovesTheMessageBack() view->setCurrentIndex(model->index(0, 0, QModelIndex())); window.findChild(QStringLiteral("delete"))->trigger(); QTRY_VERIFY_WITH_TIMEOUT(folderHasMessageFile(trash, stem), 15000); + // The file reaches the trash inside the worker BEFORE its confirmation + // crosses back and pushes the MoveCommand, so the undo has to wait for + // the stack too. Triggering on the file alone undid an empty stack, which + // Qt 6.12's quicker QTRY made deterministic. + QTRY_VERIFY_WITH_TIMEOUT(window.canUndo(), 15000); window.findChild(QStringLiteral("undo"))->trigger(); -- cgit v1.2.3