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