fix(multiplayer): publish stalled allocation recovery

This commit is contained in:
Josh Creek
2026-09-01 18:19:28 +01:00
parent 7c044b7094
commit 76c1c3d600
4 changed files with 47 additions and 4 deletions
@@ -1154,6 +1154,14 @@ func TestPostgreSQLStalledAllocationsAreReclaimedWithoutPenalisingPlayers(t *tes
if activeParticipants != 0 {
t.Fatalf("stalled match still has %d active participants, want 0 (so the player can be matched again)", activeParticipants)
}
var eventType string
var eventPayload []byte
if err := db.QueryRow(`SELECT event_type, payload FROM outbox WHERE event_id = 'stalled-allocation:stalled-match:1'`).Scan(&eventType, &eventPayload); err != nil {
t.Fatalf("stalled allocation state event missing: %v", err)
}
if eventType != "state_changed" || !strings.Contains(string(eventPayload), `"state":"FAILED"`) || !strings.Contains(string(eventPayload), `"stall-player-a"`) {
t.Fatalf("stalled allocation event = %s %s, want FAILED state and affected player IDs", eventType, eventPayload)
}
// Idempotent: the match is now FAILED, not one of the three reclaimable
// states, so a second pass must not touch it again.