mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 00:14:00 +00:00
test(multiplayer): cover queue conflict recovery wiring
This commit is contained in:
@@ -107,6 +107,20 @@ func test_queue_revision_conflicts_schedule_authoritative_recovery() -> void:
|
|||||||
assert_true(not ControlPlaneClient.should_recover_queue_after_conflict("queue_cancel", 409, ""), "missing ticket cannot trigger recovery")
|
assert_true(not ControlPlaneClient.should_recover_queue_after_conflict("queue_cancel", 409, ""), "missing ticket cannot trigger recovery")
|
||||||
|
|
||||||
|
|
||||||
|
func test_queue_conflict_response_handler_defers_ticket_recovery() -> void:
|
||||||
|
var client := ControlPlaneClient.new()
|
||||||
|
client._ready()
|
||||||
|
assert_true(client.state.begin_queue("ticket-handler", "casual"), "queue setup succeeds")
|
||||||
|
client._operation = "queue_heartbeat"
|
||||||
|
client._on_request_completed(HTTPRequest.RESULT_SUCCESS, 409, PackedStringArray(), JSON.stringify({"error": "revision conflict"}).to_utf8_buffer())
|
||||||
|
assert_eq(client._pending_resync_resource_id, "ticket-handler", "heartbeat conflict queues ticket recovery")
|
||||||
|
client._operation = "queue_cancel"
|
||||||
|
client._pending_resync_resource_id = ""
|
||||||
|
client._on_request_completed(HTTPRequest.RESULT_SUCCESS, 409, PackedStringArray(), JSON.stringify({"error": "revision conflict"}).to_utf8_buffer())
|
||||||
|
assert_eq(client._pending_resync_resource_id, "ticket-handler", "cancel conflict queues ticket recovery")
|
||||||
|
client.free()
|
||||||
|
|
||||||
|
|
||||||
func test_assignment_endpoint_split_never_accepts_url_or_bad_port() -> void:
|
func test_assignment_endpoint_split_never_accepts_url_or_bad_port() -> void:
|
||||||
var endpoint := ControlPlaneClient._split_assignment_endpoint("127.0.0.1:31001")
|
var endpoint := ControlPlaneClient._split_assignment_endpoint("127.0.0.1:31001")
|
||||||
assert_eq(endpoint["host"], "127.0.0.1", "assignment host is separated from the port")
|
assert_eq(endpoint["host"], "127.0.0.1", "assignment host is separated from the port")
|
||||||
|
|||||||
Reference in New Issue
Block a user