Flaky Test Triage
Run failing tests repeatedly, classify each failure as flaky or real, and fix only confirmed regressions.
起動プロンプト
Start the "Flaky Test Triage" loop.
Goal: classify failing tests as flaky vs real and fix only real regressions
Max iterations: 5
Between iterations run: npm test -- --testPathPattern=<failing-suite>
Exit when: every failure is classified and real regressions are fixed or explicitly deferred
Step 1: Run the failing suite multiple times. Classify each failure, fix real ones, and document flaky behavior.
Self-pace this loop. After each iteration, run the check command, read the output, and only continue if the exit condition is not met. Stop when the exit condition passes or max iterations is reached. Give a short status update each pass.基本情報
カテゴリ
テスト
目標
classify failing tests as flaky vs real and fix only real regressions
最大反復回数
5
検査コマンド
npm test -- --testPathPattern=<failing-suite>
退出条件
every failure is classified and real regressions are fixed or explicitly deferred
対応エージェント
Claude Code, Cursor
手順
- 1
Run failing tests
Run the failing test file or suite 3–5 times. Record pass/fail pattern per test.
npm test -- --testPathPattern=<failing-suite> - 2
Classify failures
Label each failure as flaky (intermittent) or real (consistent). Note timing, ordering, or env dependencies.
- 3
Fix real failures
Fix confirmed real failures with minimal changes. For flaky tests, propose stabilization (retries, isolation, mocks).
- 4
Confirm stability
Re-run the suite multiple times to confirm real failures are gone and flakiness is reduced or documented.
npm test -- --testPathPattern=<failing-suite>
他のテストのループ
Build Until Green
Run the production build, fix compile and bundling errors, and loop until the build succeeds.
Coverage Until Threshold
Add focused tests until coverage meets your threshold (e.g. 80%), without changing production behavior unnecessarily.
Pre-Commit Guard
Hook that runs tests before git commit commands to block commits when the suite is red.
Post-Edit Test Guard
Hook-based loop that runs related tests after file edits to catch regressions early.
Format Until Clean
Run the formatter, fix any remaining style issues, and loop until the codebase formats cleanly with no diffs.
Autoloop TDD
Test-first loop: write a failing test, implement the minimum code to pass, refactor, and repeat.