mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-13 22:52:03 +00:00
feat(multiplayer): add idempotent client mutation retries
This commit is contained in:
@@ -50,6 +50,15 @@ func test_websocket_event_validation_requires_contract_specific_fields() -> void
|
||||
assert_true(not ControlPlaneClient._valid_websocket_event(assignment), "incomplete assignment event is rejected")
|
||||
|
||||
|
||||
func test_retryable_mutation_policy_only_retries_safe_failures() -> void:
|
||||
assert_true(ControlPlaneClient.is_retryable_mutation_response(0), "transport failure is retryable")
|
||||
assert_true(ControlPlaneClient.is_retryable_mutation_response(408), "request timeout is retryable")
|
||||
assert_true(ControlPlaneClient.is_retryable_mutation_response(429), "rate limit is retryable")
|
||||
assert_true(ControlPlaneClient.is_retryable_mutation_response(503), "server failure is retryable")
|
||||
assert_true(not ControlPlaneClient.is_retryable_mutation_response(401), "authentication failure is not blindly replayed")
|
||||
assert_true(not ControlPlaneClient.is_retryable_mutation_response(409), "revision/idempotency conflict is not blindly replayed")
|
||||
|
||||
|
||||
func test_assignment_endpoint_split_never_accepts_url_or_bad_port() -> void:
|
||||
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")
|
||||
|
||||
Reference in New Issue
Block a user