From a1788dad3218ac674e8f9df3dae16a4339f0fb61 Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Fri, 13 Mar 2026 11:40:12 +0100 Subject: [PATCH] fix(client): guard battery test against CI on-battery false-fail (S7) Co-Authored-By: Claude Opus 4.6 --- client/tests/test_ai_dialogue_sprint26.gd | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/tests/test_ai_dialogue_sprint26.gd b/client/tests/test_ai_dialogue_sprint26.gd index 984f20574..7d881cf5d 100644 --- a/client/tests/test_ai_dialogue_sprint26.gd +++ b/client/tests/test_ai_dialogue_sprint26.gd @@ -689,8 +689,12 @@ func test_hardware_detector_inference_not_suspended_by_default() -> void: var det := _get_detector() if det == null: return - # Note: this reads live state โ€” if tests run on battery hardware the result - # may reflect a real suspension. We document this as expected. + # Skip if CI is running on battery hardware โ€” power state 1 = ON_BATTERY. + # Integer literal used: OS.POWERSTATE_* constants don't exist in this build. + var pi := _get_platform_info() + if pi != null and pi.current_power_state() == 1: + push_warning("TestAiDialogueSprint26: system is on battery (state=1) โ€” skipping default-suspended test") + return assert_bool(det.is_inference_suspended()).override_failure_message( "is_inference_suspended() must be false when hardware is FULL/plugged (D-138 ยง8)" ).is_false()