Skip to content

Commit

Permalink
upstream: fix resolver test
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneOne1 committed Feb 26, 2024
1 parent cddb79b commit cc2b026
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions upstream/resolver_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,11 @@ func TestCachingResolver_staleness(t *testing.T) {
}))

t.Run("staleness", func(t *testing.T) {
cached := r.findCached(fqdn, time.Now())
now := time.Now()
cached := r.findCached(fqdn, now)
require.ElementsMatch(t, []netip.Addr{ip4, ip6}, cached)

cached = r.findCached(fqdn, time.Now().Add(smallTTL))
cached = r.findCached(fqdn, now.Add(smallTTL+time.Second))
require.Empty(t, cached)
})
}

0 comments on commit cc2b026

Please sign in to comment.