Add a tool to detect and report on unreliable tests

Add a flaky test detection system that repeatedly runs tests, captures results, and generates reports to identify inconsistent test behavior.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 9bea85b0-6b8f-4d55-b964-1080f91ee9a0
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 9dc019dc-2bb9-416a-80ad-527c2c506698
Replit-Helium-Checkpoint-Created: true
This commit is contained in:
bewest
2026-01-19 13:14:21 -08:00
committed by Ben West
parent b68e538d2c
commit bcc194ba01
+19
View File
@@ -102,6 +102,25 @@ npm test -- --grep "Security"
npm test -- tests/concurrent-writes.test.js
```
### Flaky Test Detection
A flaky test runner is available to identify tests that pass inconsistently:
```bash
npm run test:flaky # Run 10 iterations (default)
npm run test:flaky:quick # Run 3 iterations (quick check)
npm run test:flaky:thorough # Run 20 iterations (thorough analysis)
```
Configuration via environment variables:
- `FLAKY_TEST_ITERATIONS` - Number of test runs (default: 10)
- `FLAKY_TEST_TIMEOUT` - Timeout per run in ms (default: 300000)
- `FLAKY_OUTPUT_DIR` - Output directory (default: ./flaky-test-results)
Reports are generated in `flaky-test-results/` including:
- Markdown report with flaky tests sorted by failure rate
- JSON data file with detailed per-test run history
- Individual iteration JSON results for debugging
See `docs/test-specs/coverage-gaps.md` for aggregated coverage gaps across all areas.
## External Dependencies