fix(soak): multi-hole round transitions, token refresh, dashboard wiring
- Session loop now handles round_over by clicking #ss-next-btn (the
scoresheet modal button) instead of exiting early. Waits for next
round or game_over before continuing.
- SessionPool detects expired tokens on acquire and re-logins
automatically, writing fresh credentials to .env.stresstest.
- Added 2s post-game delay before goto('/') so the server can process
game completion before WebSocket disconnect.
- Wired dashboard metrics (games_completed, moves_total, errors),
activity log entries, and player tiles for both populate and stress
scenarios.
- Bumped screencast resolution to 960x540 and set headless viewport
to 960x800 for better click-to-watch framing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -50,9 +50,15 @@ async function runRoom(
|
||||
let completed = 0;
|
||||
const errors: ScenarioError[] = [];
|
||||
|
||||
// Send player list for dashboard tiles
|
||||
ctx.dashboard.update(roomId, {
|
||||
players: sessions.map((s) => ({ key: s.key, score: null, isActive: false })),
|
||||
});
|
||||
|
||||
for (let gameNum = 0; gameNum < cfg.gamesPerRoom; gameNum++) {
|
||||
if (ctx.signal.aborted) break;
|
||||
ctx.dashboard.update(roomId, { game: gameNum + 1, totalGames: cfg.gamesPerRoom });
|
||||
ctx.dashboard.log('info', `${roomId}: starting game ${gameNum + 1}/${cfg.gamesPerRoom}`);
|
||||
ctx.logger.info('game_start', { room: roomId, game: gameNum + 1 });
|
||||
|
||||
const result = await runOneMultiplayerGame(ctx, sessions, {
|
||||
@@ -66,6 +72,9 @@ async function runRoom(
|
||||
|
||||
if (result.completed) {
|
||||
completed++;
|
||||
ctx.dashboard.incrementMetric('games_completed');
|
||||
ctx.dashboard.incrementMetric('moves_total', result.turns);
|
||||
ctx.dashboard.log('info', `${roomId}: game ${gameNum + 1} complete — ${result.turns} turns, ${(result.durationMs / 1000).toFixed(1)}s`);
|
||||
ctx.logger.info('game_complete', {
|
||||
room: roomId,
|
||||
game: gameNum + 1,
|
||||
@@ -73,6 +82,8 @@ async function runRoom(
|
||||
durationMs: result.durationMs,
|
||||
});
|
||||
} else {
|
||||
ctx.dashboard.incrementMetric('errors');
|
||||
ctx.dashboard.log('error', `${roomId}: game ${gameNum + 1} failed — ${result.error}`);
|
||||
errors.push({
|
||||
room: roomId,
|
||||
reason: 'game_failed',
|
||||
|
||||
Reference in New Issue
Block a user