Skip to content

fix(test): fix ui_qt_test not executing offscreen

Lucas SCHMIDT requested to merge 722-test-ui_qt_test-randomly-fails into dev

Description

ui_qt_test didn't execute offscreen because the "-platform offscreen" args were consumed by QApplication, and argc and argv were globals, so it worked for the first test, but the following tests didn't have those args anymore.

I also modified the test launcher script in order to execute xvfb-run only when it is needed, that is when the test actually requires a graphic environment (for now, this is true for only one test, viz_scene3dtest). For this, I added a "REQUIRE_X" argument to the sight_add_target CMake macro.

Closes #722 (closed)

How to test it?

Cross your fingers? The issue is pretty hard to reproduce, so an idea would be to run the tests like 1000 times in a headless environment, and check if it passes. Anyway, if the problem still happens, we will simply create another issue. Again.

Merge request reports