ADR-005: Concurrent Testing with Unique Data Strategy
· 1min · adrs
Status:
Accepted
Context:
Need fast, reliable test execution without race conditions. Traditional global database cleanup between tests creates conflicts when tests run concurrently, leading to foreign key violations and test flakiness.
Decision:
Run tests concurrently with unique test data generation using generateTestId() instead of database cleanup. Each test creates unique emails and identifiers to prevent data collisions.
Consequences:
✅ 10x faster test execution compared to sequential runs ✅ Eliminates race conditions from global cleanup ✅ Better test isolation and reliability ✅ More realistic concurrent load testing ✅ Simpler test maintenance without cleanup logic ❌ Test data accumulates in database (mitigated by periodic manual resets) ❌ Requires discipline to use unique identifiers consistently