From 0d2f94c1bf3db5a8de16e712bc3d8d63047a7266 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 00:27:49 -0500 Subject: [PATCH] Modes: deflake restart test (opening hand may have no turn-1 play) Co-Authored-By: Claude Opus 5.5 --- tests/modes-api.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/modes-api.test.ts b/tests/modes-api.test.ts index 2ac1c55..291a413 100644 --- a/tests/modes-api.test.ts +++ b/tests/modes-api.test.ts @@ -225,8 +225,9 @@ test('modes api: live matches survive a node restart (snapshot on shutdown, rest persistLive(first, dir, false); const a = first.createLobby('classic', alice); const b = await first.join(a.lobbyId, bob); - const play = (first.view(a.lobbyId, a.token) as any).legalActions.find((x: any) => x.type === 'play'); - await first.act(a.lobbyId, a.token, play); + // Random seed: the opening hand may have nothing playable on turn 1, so fall back to commit. + const legal = (first.view(a.lobbyId, a.token) as any).legalActions; + await first.act(a.lobbyId, a.token, legal.find((x: any) => x.type === 'play') ?? legal.find((x: any) => x.type === 'commit')); const d = first.createLobby('draft', alice); const e = await first.join(d.lobbyId, bob); const pick = (first.view(d.lobbyId, d.token) as any).draft;