fix(#229): Remediate code review findings for performance tests
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/pr/woodpecker Pipeline failed

- 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:
Jason Woltje
2026-02-05 13:23:19 -06:00
parent b93f4c59ce
commit 0796cbc744
3 changed files with 97 additions and 78 deletions

View File

@@ -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);
});
});
});