From 12047503e2ec75fe0315bbe6bbd22e1441ba0b55 Mon Sep 17 00:00:00 2001 From: dingo Date: Wed, 7 Oct 2026 15:55:27 -0400 Subject: [PATCH] Bound X11 lifecycle stress in client CI --- docs/engineering/VALIDATION.md | 14 ++++++++++++++ tests/client_lifecycle.cpp | 11 +++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/docs/engineering/VALIDATION.md b/docs/engineering/VALIDATION.md index 5eea9d5..3bc6143 100644 --- a/docs/engineering/VALIDATION.md +++ b/docs/engineering/VALIDATION.md @@ -5008,3 +5008,17 @@ the governor itself remains covered by its unit tests. Executed: local `postgres-check.sh` with QUIC, all suites. The CI result for this commit is checked via the Gitea API after the push. + +## 2026-10-07 — X11 lifecycle check scope + +The client CTest lifecycle suite runs 32 full open/event/close cycles with SDL's dummy +video driver. The additional Xvfb invocation runs one full cycle under X11, alongside +the X11 rendering and UI-probe runs. This retains real X11 creation, software rendering, +resize, input/window events, renderer reset/loss and teardown coverage while avoiding a +second 32-cycle stress loop on the Xvfb backend. If `Application::open()` fails in this +test, its output includes the cycle and typed application error before SDL teardown. + +Evidence: in the 2026-10-07 Gitea client run, all 13 CTest tests and the X11 probe/UI +smokes passed; only the extra 32-cycle X11 invocation failed at `Application::open()`. +The same 32-cycle lifecycle test passed under SDL's dummy driver. The X11 failure did +not report its typed error, so the failing X11 backend stage was not established. diff --git a/tests/client_lifecycle.cpp b/tests/client_lifecycle.cpp index 6b2e303..4f8b6e3 100644 --- a/tests/client_lifecycle.cpp +++ b/tests/client_lifecycle.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include void client_controls_tests(); @@ -89,9 +90,15 @@ void lifecycle() { CHECK(refused(Application::open({0, 64, false, "software"}), Error::invalid_config)); CHECK(refused(Application::open({64, 64, false, "evo-invalid"}), Error::renderer)); CHECK(SDL_WasInit(0) == 0); // Failed partial initialization released SDL. - for (int round = 0; round < 32; ++round) { + const char* video_driver = std::getenv("SDL_VIDEO_DRIVER"); + const int rounds = video_driver != nullptr && std::string_view{video_driver} == "x11" ? 1 : 32; + for (int round = 0; round < rounds; ++round) { auto result = Application::open({160, 120, false, "software"}); - CHECK(result); + if (!result) { + throw std::runtime_error( + "client lifecycle open failed round=" + std::to_string(round) + " error=" + + std::to_string(static_cast(result.error())) + " SDL=" + SDL_GetError()); + } auto app = std::move(result.value()); CHECK(refused(Application::open({}), Error::already_open)); CHECK(app->step(frame) == Step::rendered);