Fix tests if filesystem stores less precise times

Not all filesystems store modification times with millisecond precision.
This commit is contained in:
William Elwood 2019-11-14 12:40:52 +00:00
parent 2c49804bd0
commit e016300aab
1 changed files with 1 additions and 1 deletions

View File

@ -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