mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-09-30 12:39:42 +02:00
fix(test): allow timing variance in StaleExpirationMap remaining TTL test
setTimeout isn't exact, so the remaining TTL after 100ms wait may be slightly more than expected (901ms instead of ≤900ms). Adding 10ms tolerance to prevent flaky test failures. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -228,7 +228,8 @@ describe('StaleExpirationMap', () => {
|
||||
|
||||
const remaining = map.getRemainingTtl('a');
|
||||
expect(remaining).toBeDefined();
|
||||
expect(remaining!).toBeLessThanOrEqual(900);
|
||||
// Allow small timing variance (setTimeout isn't exact)
|
||||
expect(remaining!).toBeLessThanOrEqual(910);
|
||||
expect(remaining!).toBeGreaterThan(800);
|
||||
|
||||
map.dispose();
|
||||
|
||||
Reference in New Issue
Block a user