Summary
5 tests hang indefinitely because modal dialogs block the QtTesting event playback loop, preventing QApplication::exit() from being reached. They have been temporarily disabled via DISABLED TRUE with the label ModalDialogHang in commit 14241b2.
Affected tests
| Test |
Module |
Root cause |
ctkFontButtonTest |
CTKWidgets |
Modal QFontDialog blocks event loop |
ctkColorPickerButtonEventTranslatorPlayerTest1 |
CTKWidgets |
Modal QColorDialog blocks event loop |
ctkDirectoryButtonEventTranslatorPlayerTest1 |
CTKWidgets |
Modal file dialog blocks event loop |
ctkFileDialogEventTranslatorPlayerTest1 |
CTKWidgets |
Modal ctkFileDialog blocks event loop |
ctkVTKTextPropertyWidgetEventTranslatorPlayerTest1 |
CTKVisualizationVTKWidgets |
Modal dialog blocks event loop |
How to reproduce
# These tests will hang until killed (confirmed at 300s timeout)
ctest --test-dir CTK-build -R "ctkFontButtonTest|ctkColorPickerButtonEventTranslatorPlayerTest1|ctkDirectoryButtonEventTranslatorPlayerTest1|ctkFileDialogEventTranslatorPlayerTest1|ctkVTKTextPropertyWidgetEventTranslatorPlayerTest1" --timeout 300
How to force-run disabled tests
# Run only the ModalDialogHang tests (they are DISABLED, so use --force-new-ctest-process)
ctest --test-dir CTK-build -L ModalDialogHang --timeout 300
# Or override DISABLED for all tests
cmake -DCTEST_USE_LAUNCHERS=OFF CTK-build
ctest --test-dir CTK-build -R "ctkFontButtonTest|ctkColorPickerButton" --timeout 300
Note: CTest skips DISABLED tests even when matched by -R or -L. To actually execute them, temporarily remove the DISABLED TRUE property from the relevant CMakeLists.txt.
Suggested fix
The underlying issue is that ctkEventTranslatorPlayerWidget::play() calls QApplication::exit() after all test cases complete, but modal dialogs (exec()) block the playback loop so exit() is never reached. A fix would need to:
- Dismiss modal dialogs via
QTimer::singleShot before they block (similar to the pattern in CLAUDE.md for Qt5+Qt6 safe modal dialog testing)
- Or restructure the event playback to handle modal dialogs asynchronously
Files
Libs/Widgets/Testing/Cpp/CMakeLists.txt
Libs/Visualization/VTK/Widgets/Testing/Cpp/CMakeLists.txt
Summary
5 tests hang indefinitely because modal dialogs block the QtTesting event playback loop, preventing
QApplication::exit()from being reached. They have been temporarily disabled viaDISABLED TRUEwith the labelModalDialogHangin commit 14241b2.Affected tests
ctkFontButtonTestQFontDialogblocks event loopctkColorPickerButtonEventTranslatorPlayerTest1QColorDialogblocks event loopctkDirectoryButtonEventTranslatorPlayerTest1ctkFileDialogEventTranslatorPlayerTest1ctkFileDialogblocks event loopctkVTKTextPropertyWidgetEventTranslatorPlayerTest1How to reproduce
How to force-run disabled tests
Note: CTest skips
DISABLEDtests even when matched by-Ror-L. To actually execute them, temporarily remove theDISABLED TRUEproperty from the relevantCMakeLists.txt.Suggested fix
The underlying issue is that
ctkEventTranslatorPlayerWidget::play()callsQApplication::exit()after all test cases complete, but modal dialogs (exec()) block the playback loop soexit()is never reached. A fix would need to:QTimer::singleShotbefore they block (similar to the pattern in CLAUDE.md for Qt5+Qt6 safe modal dialog testing)Files
Libs/Widgets/Testing/Cpp/CMakeLists.txtLibs/Visualization/VTK/Widgets/Testing/Cpp/CMakeLists.txt