Merge pull request #2716 from MichaelEischer/revert-apfs-test-workaround

Revert "Darwin test fix: allow 1μs timestamp difference"
This commit is contained in:
MichaelEischer 2020-05-01 18:13:38 +02:00 committed by GitHub
commit 843e7f404e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -72,17 +72,7 @@ func sameModTime(fi1, fi2 os.FileInfo) bool {
}
}
same := fi1.ModTime().Equal(fi2.ModTime())
if !same && (runtime.GOOS == "darwin" || runtime.GOOS == "openbsd") {
// Allow up to 1μs difference, because macOS <10.13 cannot restore
// with nanosecond precision and the current version of Go (1.9.2)
// does not yet support the new syscall. (#1087)
mt1 := fi1.ModTime()
mt2 := fi2.ModTime()
usecDiff := (mt1.Nanosecond()-mt2.Nanosecond())/1000 + (mt1.Second()-mt2.Second())*1000000
same = usecDiff <= 1 && usecDiff >= -1
}
return same
return fi1.ModTime().Equal(fi2.ModTime())
}
// directoriesEqualContents checks if both directories contain exactly the same