fix(multiplayer): advance tickets on allocation bind

This commit is contained in:
Josh Creek
2026-09-01 10:42:10 +01:00
parent 25fdc2c2c8
commit 013eb0778b
5 changed files with 41 additions and 24 deletions
@@ -189,6 +189,10 @@ func TestPostgreSQLAllocationMatchClaimLeaseAndBindFence(t *testing.T) {
if err := BindAllocatedMatch(ctx, db, allocation); err != nil {
t.Fatalf("bind allocation: %v", 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)
}
if _, found, err := ClaimAllocatingMatch(ctx, db, "enet", now.Add(2*time.Second)); err != nil || found {
t.Fatalf("bound match re-claimed found=%t err=%v", found, err)
}