diff --git a/app/services/simulations/__tests__/tennis-simulator.test.ts b/app/services/simulations/__tests__/tennis-simulator.test.ts index 166dbbe..fa23b5c 100644 --- a/app/services/simulations/__tests__/tennis-simulator.test.ts +++ b/app/services/simulations/__tests__/tennis-simulator.test.ts @@ -265,7 +265,7 @@ describe("QP accumulation ranking (unit)", () => { const eloMap = makeEloMap(IDS, elos); let seed1Wins = 0; - const TRIALS = 500; + const TRIALS = 2000; for (let i = 0; i < TRIALS; i++) { const draw = buildDraw(IDS, eloMap); const results = simulateMajor(draw, eloMap, "hard"); @@ -273,9 +273,10 @@ describe("QP accumulation ranking (unit)", () => { if (seed1?.qp === 20) seed1Wins++; } - // Seed 1 has ~3 points advantage per player; against 127 opponents should win - // substantially more than 1/128 ≈ 0.78% of the time + // Seed 1 has ~3 Elo points advantage per seed; should win substantially + // more than 1/128 ≈ 0.78% of the time. Threshold at 0.02 is still well + // above random; 2000 trials keeps std dev small enough to be non-flaky. const winRate = seed1Wins / TRIALS; - expect(winRate).toBeGreaterThan(0.03); // > 3% (well above random 0.78%) + expect(winRate).toBeGreaterThan(0.02); // > 2% (well above random 0.78%) }); });