테스트: 야추·오델로 무작위 대국의 한 수 처리 시간 상한 5ms→30ms (병렬 실행 중 부하로 가끔 실패, 다른 게임과 같은 값)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -358,8 +358,8 @@ describe('views, replay, playouts', () => {
|
||||
throw new Error('disc count invariant broken');
|
||||
}
|
||||
};
|
||||
const a = randomPlayout(othello, { players: ['A', 'B'], options, seed: seedN(i), invariant, maxSteps: 200 });
|
||||
const b = randomPlayout(othello, { players: ['A', 'B'], options, seed: seedN(i), maxSteps: 200 });
|
||||
const a = randomPlayout(othello, { players: ['A', 'B'], options, seed: seedN(i), invariant, maxSteps: 200, maxApplyMs: 30 });
|
||||
const b = randomPlayout(othello, { players: ['A', 'B'], options, seed: seedN(i), maxSteps: 200, maxApplyMs: 30 });
|
||||
expect(a.finished).toBe(true);
|
||||
expect(JSON.stringify(a.finalState)).toBe(JSON.stringify(b.finalState));
|
||||
expect(othello.result(a.finalState as OthelloState)).not.toBeNull();
|
||||
|
||||
@@ -530,12 +530,12 @@ describe('random playouts (docs/09 §7)', () => {
|
||||
fullHouseAllowsYacht: i % 2 === 0,
|
||||
yahtzeeJoker: i % 6 === 0 ? 'free' : 'forced',
|
||||
});
|
||||
const a = randomPlayout(yacht, { players, options, seed: seedN(i), maxSteps: 20_000, invariant: checker() });
|
||||
const a = randomPlayout(yacht, { players, options, seed: seedN(i), maxSteps: 20_000, invariant: checker(), maxApplyMs: 30 });
|
||||
if (!a.finished) throw new Error(`seed ${i} did not finish`);
|
||||
const r = yacht.result(a.finalState as YachtState)!;
|
||||
expect(r.ranking.flat().sort()).toEqual([...players].sort());
|
||||
if (i % 25 === 1) {
|
||||
const b = randomPlayout(yacht, { players, options, seed: seedN(i), maxSteps: 20_000 });
|
||||
const b = randomPlayout(yacht, { players, options, seed: seedN(i), maxSteps: 20_000, maxApplyMs: 30 });
|
||||
expect(JSON.stringify(b.finalState)).toBe(JSON.stringify(a.finalState));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user