Documentation
¶
Overview ¶
tinydur flags a sub-resolution duration in a Go test: time.Nanosecond or time.Microsecond used as a value in a *_test.go file.
tinydur DIR... # each DIR (or *_test.go file) is walked
The smell: a test forces cache/TTL staleness with a duration so small that `time.Since(x) < d` is expected to read "stale" between two near-instant calls (`Refresh: caddy.Duration(time.Nanosecond)`). On Windows the clock is coarse, time.Since can read 0, the entry still counts as fresh, the refresh is skipped and the test fails on windows-latest only (mholt/caddy-l4 #429, TestSRVReleasesDroppedPeerReferences). Expire the state deterministically instead: an injected clock, an explicit invalidate/expire call, a fake entry with a past timestamp.