aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-11-30 12:06:17 +0100
committerDanilo M. <danix@danix.xyz>2026-11-30 12:06:17 +0100
commite7da569d1287b53ce872d9bc75e88e8c78e3af02 (patch)
treee72b41a1df91edcddab191417af7f30ec6b2a6b3
parent2a568ea0cce16e77f4c8391408cd996f6b576dab (diff)
downloadqtmaildir-e7da569d1287b53ce872d9bc75e88e8c78e3af02.tar.gz
qtmaildir-e7da569d1287b53ce872d9bc75e88e8c78e3af02.zip
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 <noreply@anthropic.com>
-rw-r--r--tests/CMakeLists.txt4
-rw-r--r--tests/test_mainwindow.cpp5
2 files changed, 8 insertions, 1 deletions
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<QAction *>(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<QAction *>(QStringLiteral("undo"))->trigger();