fix(#229): Remediate code review findings for performance tests
- Fix CRITICAL: Increase single-spawn threshold from 10ms to 50ms (CI flakiness) - Fix CRITICAL: Replace no-op validation test with real backoff scale tests - Fix IMPORTANT: Add warmup iterations before all timed measurements - Fix IMPORTANT: Increase scan position ratio tolerance to 10x for sub-ms noise - Refactored queue perf tests to use actual service methods (calculateBackoffDelay) - Helper function to reduce spawn request duplication Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -115,9 +115,9 @@ describe("Performance: Secret Scanner", () => {
|
||||
expect(duration1).toBeLessThan(100);
|
||||
expect(duration2).toBeLessThan(100);
|
||||
|
||||
// And be within 5x of each other (no pathological behavior)
|
||||
const ratio = Math.max(duration1, duration2) / Math.max(0.01, Math.min(duration1, duration2));
|
||||
expect(ratio).toBeLessThan(5);
|
||||
// Both should complete within a reasonable ratio (allowing for sub-ms noise)
|
||||
const ratio = Math.max(duration1, duration2) / Math.max(0.1, Math.min(duration1, duration2));
|
||||
expect(ratio).toBeLessThan(10);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user