mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 08:23:45 +00:00
fix(multiplayer): bound workload credential lifetime
This commit is contained in:
@@ -26,6 +26,7 @@ func test_defaults_apply_when_nothing_is_given() -> void:
|
||||
assert_true(config.is_valid(), "an empty command line is valid")
|
||||
assert_eq(config.get_value("port"), 7777, "default port")
|
||||
assert_eq(config.get_value("max-matches"), 0, "0 means run forever")
|
||||
assert_eq(config.get_value("max-overtime-seconds"), 900.0, "allocated sudden death has a finite safety cap")
|
||||
assert_eq(config.get_value("log-level"), "info", "default log level")
|
||||
|
||||
|
||||
@@ -98,6 +99,7 @@ func test_out_of_range_values_are_rejected_with_their_own_message() -> void:
|
||||
assert_true(not _parse(["--port=70000"]).is_valid(), "port 70000 is out of range")
|
||||
assert_true(not _parse(["--max-clients=0"]).is_valid(), "a server for nobody is rejected")
|
||||
assert_true(not _parse(["--match-length=0"]).is_valid(), "a zero-length match is rejected")
|
||||
assert_true(not _parse(["--max-overtime-seconds=0"]).is_valid(), "an unbounded allocated overtime cap is rejected")
|
||||
assert_true(not _parse(["--log-level=chatty"]).is_valid(), "an undefined log level is rejected")
|
||||
assert_true(not _parse(["--arena-rotation=spiral"]).is_valid(), "an undefined rotation mode is rejected")
|
||||
assert_true(not _parse(["--arena-path=res://scenes/arena_01_elevated.tscn"]).is_valid(), "an elevated arena cannot be selected for allocated ranked play")
|
||||
|
||||
@@ -21,3 +21,11 @@ func test_only_a_committed_result_acknowledgement_releases_the_match() -> void:
|
||||
assert_true(not Client.response_is_accepted(200), "an unexpected generic success cannot lose the result")
|
||||
assert_true(not Client.response_is_accepted(422), "validation failure remains held for operator-visible retry")
|
||||
assert_true(not Client.response_is_accepted(503), "outage remains held for retry")
|
||||
|
||||
|
||||
func test_review_results_are_permitted_but_forged_states_are_not() -> void:
|
||||
var client := Client.new()
|
||||
assert_true(client.configure("https://control.invalid", "token", "match-123456789", "server-123456789"), "test client configures")
|
||||
# submit itself is asynchronous; the pure configuration boundary proves the
|
||||
# reporter can carry the REVIEW state selected by bounded overtime.
|
||||
assert_true(Client.result_nonce("match-123456789", "server-123456789", 1, 1, "REVIEW") != Client.result_nonce("match-123456789", "server-123456789", 1, 1, "CERTIFIED"), "integrity state binds the receipt identity")
|
||||
|
||||
Reference in New Issue
Block a user