mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-12 04:43:44 +00:00
fix(multiplayer): advance tickets on allocation bind
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user