-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
Building a cache loader that uses both stats and expiration (eg recordStats and expireAfterWrite) and providing a ticker for testing builds a cache that uses system time for stats and the provided ticker for expiration.
This can become a problem because the CacheStats constructor validates that variables are not negative, which they can become if the stubbed ticker's time is in the future (or more than System.nanoTime), in general it's possible to test refresh by ensuring that start time + refresh time is never more than System.nanoTime, but when the computer is restarted (On my linux desktop the jvm seems to use time since startup) tests can not be made to pass until the uptime is more than the refresh time.
Metadata
Metadata
Assignees
Labels
No labels