test: verify offline matchmaking pipeline

This commit is contained in:
Josh Creek
2026-08-31 21:04:22 +01:00
parent c0d1c33f54
commit 723f8aea5d
4 changed files with 96 additions and 2 deletions
+17
View File
@@ -45,6 +45,23 @@ func TestProposalResponseReplayIsStableAndPayloadReuseConflicts(t *testing.T) {
}
}
func TestReturnedProposalRetainsIdempotencyStateForChainedResponses(t *testing.T) {
now := time.Unix(1000, 0)
p, err := NewProposal("proposal-123456789", Ranked, []string{"a", "b", "c", "d", "e", "f"}, now)
if err != nil {
t.Fatal(err)
}
for _, playerID := range []string{"a", "b", "c", "d", "e", "f"} {
p, err = p.Respond(playerID, "accept-"+playerID+"-123456", true, p.Revision, now)
if err != nil {
t.Fatal(err)
}
}
if p.State != Accepted || p.Revision != 6 {
t.Fatalf("chained responses = %+v", p)
}
}
func TestProposalExpiryTimesOutPendingParticipantsAndClosesRace(t *testing.T) {
now := time.Unix(1000, 0)
p, err := NewProposal("proposal-123456789", Ranked, []string{"a", "b", "c", "d", "e", "f"}, now)