mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-13 12:22:04 +00:00
fix(multiplayer): recover assignment handoff
This commit is contained in:
@@ -306,6 +306,10 @@ func TestPostgreSQLAllocationMatchClaimLeaseAndBindFence(t *testing.T) {
|
||||
if err := BindAllocatedMatch(ctx, db, allocation); err != nil {
|
||||
t.Fatalf("bind allocation: %v", err)
|
||||
}
|
||||
recoveredTicket, err := GetQueueTicket(ctx, db, "allocation-match-a", "allocation-match-ticket-0", now.Add(2*time.Second))
|
||||
if err != nil || recoveredTicket.MatchID != "allocation-match" {
|
||||
t.Fatalf("recovered ticket match=%q err=%v", recoveredTicket.MatchID, err)
|
||||
}
|
||||
var allocatingTickets int
|
||||
if err := db.QueryRowContext(ctx, `SELECT count(*) FROM queue_tickets WHERE ticket_id LIKE 'allocation-match-ticket-%' AND state = 'ALLOCATING'`).Scan(&allocatingTickets); err != nil || allocatingTickets != 2 {
|
||||
t.Fatalf("allocating tickets=%d err=%v", allocatingTickets, err)
|
||||
|
||||
Reference in New Issue
Block a user