Skip to content

Fix flaky and broken tests across E2E and unit suites#240

Merged
xenobiasoft merged 1 commit into
mainfrom
fix/test-flakiness
Apr 26, 2026
Merged

Fix flaky and broken tests across E2E and unit suites#240
xenobiasoft merged 1 commit into
mainfrom
fix/test-flakiness

Conversation

@xenobiasoft
Copy link
Copy Markdown
Owner

Summary

  • E2E cell interaction tests (game.spec.ts): The initialGame/gameAfterMove fixtures used makeTestGame() — a near-solved board with only one empty cell. Placing any value on that cell produced a fully solved board, which caused isSolved() to return true and replaced the game board with the victory overlay before the assertion could run. Added makeTestGameForInteraction() (two empty cells) and makeTestGameAfterInteractionMove() (one filled, one still empty) so the board stays visible after the move.

  • GameTimerTests.OnTick_ShouldFireAtInterval (GameTimerTests.cs): The test waited only _interval × 5 (50 ms at a 10 ms interval) before asserting ≥ 3 ticks. Under CI scheduling jitter this gave only 2 ticks. Doubled the wait to _interval × 10 for reliable headroom.

Test plan

  • dotnet test — 710/710 passing (was 709/710)
  • npm run test in Sudoku.React — 139/139 passing
  • npx playwright test --project=react in Tests/E2E — 26/26 passing (was 24/26)

🤖 Generated with Claude Code

- E2E cell interaction tests used a near-solved board with one empty cell,
  so any move completed the puzzle and triggered the victory display before
  the assertion could run; introduce two-empty-cell factories so filling
  cell (0,0) leaves isSolved() false and the board stays visible
- GameTimerTests.OnTick_ShouldFireAtInterval waited only 5x the interval,
  giving insufficient headroom under CI scheduling jitter; double the wait
  to 10x so the tick count reliably reaches the >=3 threshold

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://gray-bush-02024e71e-240.westus2.7.azurestaticapps.net

@xenobiasoft xenobiasoft merged commit 2346313 into main Apr 26, 2026
10 checks passed
@xenobiasoft xenobiasoft deleted the fix/test-flakiness branch April 26, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant