From f7657ad9ad3aa6dd865bd2adffba7f87f94f0fb6 Mon Sep 17 00:00:00 2001 From: Josh Creek <8179928+jcreek@users.noreply.github.com> Date: Tue, 1 Sep 2026 14:16:06 +0100 Subject: [PATCH] test(multiplayer): extend the real integration test to cover queue cancel Adds a fourth real round trip to control_plane_smoke.gd: heartbeat -> cancel_queue -> CANCELLED, using the same idle-wait pattern the heartbeat step already needed. Verified stable across 3 consecutive full runs (real Postgres, real testkit-api, real headless Godot client), plus the full Go and Godot unit suites clean. --- Game/tests/control_plane_smoke.gd | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Game/tests/control_plane_smoke.gd b/Game/tests/control_plane_smoke.gd index 32301cf2..0a3d108d 100644 --- a/Game/tests/control_plane_smoke.gd +++ b/Game/tests/control_plane_smoke.gd @@ -88,7 +88,13 @@ func _on_request_succeeded(operation: String, payload: Dictionary) -> void: if int(payload.get("revision", -1)) <= 0: _finish(false, "heartbeat did not advance the revision: %s" % payload) return - _finish(true, "login -> queue_create -> heartbeat all round-tripped against a real server") + print("SMOKE: heartbeat advanced to revision %d, cancelling..." % ControlPlaneClient.state.revision) + _send_cancel_once_idle() + "queue_cancel": + if payload.get("state", "") != "CANCELLED": + _finish(false, "unexpected queue_cancel payload: %s" % payload) + return + _finish(true, "login -> queue_create -> heartbeat -> cancel all round-tripped against a real server") func _send_heartbeat_once_idle() -> void: @@ -104,6 +110,16 @@ func _send_heartbeat_once_idle() -> void: _finish(false, "heartbeat() failed to start: %s" % error_string(err)) +func _send_cancel_once_idle() -> void: + if not ControlPlaneClient._operation.is_empty(): + var poll := get_tree().create_timer(0.05) + poll.timeout.connect(_send_cancel_once_idle) + return + var err := ControlPlaneClient.cancel_queue(_ticket_id, ControlPlaneClient.state.revision) + if err != OK: + _finish(false, "cancel_queue() failed to start: %s" % error_string(err)) + + func _on_request_failed(operation: String, http_code: int, detail: String) -> void: if _finished: return