From e016300aabffd3867085bd89f7cb3fda94f8f612 Mon Sep 17 00:00:00 2001 From: William Elwood Date: Thu, 14 Nov 2019 12:40:52 +0000 Subject: [PATCH] Fix tests if filesystem stores less precise times Not all filesystems store modification times with millisecond precision. --- dnscrypt-proxy/sources_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dnscrypt-proxy/sources_test.go b/dnscrypt-proxy/sources_test.go index 58c58f02..bc5ebb04 100644 --- a/dnscrypt-proxy/sources_test.go +++ b/dnscrypt-proxy/sources_test.go @@ -264,7 +264,7 @@ func setupSourceTest(t *testing.T) (func(), *SourceTestData) { "no-urls": {}, } d.xTransport.rebuildTransport() - d.timeNow = time.Now().AddDate(0, 0, 0) + d.timeNow = time.Now().AddDate(0, 0, 0).Truncate(time.Second) d.timeOld = d.timeNow.Add(DefaultPrefetchDelay * -4) d.timeUpd = d.timeNow.Add(DefaultPrefetchDelay) timeNow = func() time.Time { return d.timeNow } // originally defined in sources.go, replaced during testing to ensure consistent results