From 9a724bf5621e605a558ce8b7e7ed8114de6fb06a Mon Sep 17 00:00:00 2001 From: Josh Creek <8179928+jcreek@users.noreply.github.com> Date: Thu, 3 Sep 2026 21:28:21 +0100 Subject: [PATCH] test(multiplayer): recover from native Godot crashes --- scripts/test_verify_multiplayer_local.py | 5 +++++ scripts/verify_multiplayer_local.sh | 14 +++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/scripts/test_verify_multiplayer_local.py b/scripts/test_verify_multiplayer_local.py index 25279514..32796532 100644 --- a/scripts/test_verify_multiplayer_local.py +++ b/scripts/test_verify_multiplayer_local.py @@ -14,6 +14,11 @@ class LocalMultiplayerGateTest(unittest.TestCase): self.assertIn("type=bind,src=$root_dir,dst=/workspace", script) self.assertIn("Godot executable not found", script) + def test_native_engine_crash_falls_back_but_test_failure_does_not(self): + script = (ROOT / "scripts" / "verify_multiplayer_local.sh").read_text() + self.assertIn('if [[ "$native_status" -lt 128 ]]', script) + self.assertIn("native Godot crashed", script) + if __name__ == "__main__": unittest.main() diff --git a/scripts/verify_multiplayer_local.sh b/scripts/verify_multiplayer_local.sh index 0b44d8fd..aa5bd7d2 100755 --- a/scripts/verify_multiplayer_local.sh +++ b/scripts/verify_multiplayer_local.sh @@ -7,8 +7,20 @@ godot_image="barichello/godot-ci@sha256:622e5ca81b54cd8038ecf7de5d157b47efc800d7 run_godot_harness() { if [[ -x "$godot_bin" ]]; then + set +e "$godot_bin" --headless --path "$root_dir/Game" res://tests/test_runner.tscn - return + local native_status=$? + set -e + if [[ "$native_status" -eq 0 ]]; then + return + fi + # A failing test exits 1 and must fail the gate. A signal exit (as seen + # with the host Metal/Vulkan stack) is an engine-host failure, so rerun + # the identical pinned Linux harness instead of losing all verification. + if [[ "$native_status" -lt 128 ]]; then + return "$native_status" + fi + echo "local multiplayer gate: native Godot crashed (status $native_status); using pinned headless fallback" >&2 fi if ! command -v docker >/dev/null 2>&1 || ! docker info >/dev/null 2>&1; then echo "local multiplayer gate: Godot executable not found ($godot_bin), and Docker is unavailable for the pinned headless fallback" >&2