From 45f04f50feace49d98f6fb2ea26ad03a2d25c657 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Mon, 27 Jul 2026 23:23:17 +0200 Subject: [PATCH] test(mgmt): gamescope reports no monitors, and that is not a missing explanation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /display/monitors must never answer empty AND silent — the console reads that as "the host is broken". But gamescope is nested: it owns no physical heads by construction, so empty-and-silent is the correct answer there, not an unexplained one. Any dev box that has ever been in game mode keeps gamescope-0 sockets in its runtime dir, so detect() resolves gamescope and the test failed on the machine rather than on the code (found running the suite on .136). Co-Authored-By: Claude Opus 5 (1M context) --- crates/punktfunk-host/src/mgmt/tests.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/punktfunk-host/src/mgmt/tests.rs b/crates/punktfunk-host/src/mgmt/tests.rs index d7d77a7e..c605f83c 100644 --- a/crates/punktfunk-host/src/mgmt/tests.rs +++ b/crates/punktfunk-host/src/mgmt/tests.rs @@ -1070,9 +1070,14 @@ async fn display_monitors_answers_even_with_no_compositor() { // No compositor on the test host ⇒ either a clean empty list or an explained failure, never // both empty AND silent about why. let listed = body["monitors"].as_array().map(|a| a.len()).unwrap_or(0); + // gamescope is nested: it owns no physical heads by construction, so "empty and silent" is the + // correct answer there, not an unexplained one. A dev box that has ever been in game mode keeps + // `gamescope-0` sockets in its runtime dir, so `detect()` resolves gamescope and this test would + // otherwise fail on the machine rather than on the code (found running the suite on .136). + let nested = body["compositor"] == "gamescope"; assert!( - listed > 0 || !body["error"].is_null() || body["compositor"].is_null(), - "an empty list must carry an error or an absent compositor: {body}" + listed > 0 || !body["error"].is_null() || body["compositor"].is_null() || nested, + "an empty list must carry an error, an absent compositor, or a nested one: {body}" ); // The pin is reported verbatim so the console can flag "pinned to a monitor you don't have"; // unset on the test host.