From b851c516e33713e8c5d92cca16a096e058254380 Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Tue, 17 Mar 2015 16:30:03 +1100 Subject: [PATCH] Fixed AttributeCachingTest.StatMtimeStat_ViaPath on OS X. --- samples/cachingfs/caching_fs_test.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/samples/cachingfs/caching_fs_test.go b/samples/cachingfs/caching_fs_test.go index ad9efd8..90aa803 100644 --- a/samples/cachingfs/caching_fs_test.go +++ b/samples/cachingfs/caching_fs_test.go @@ -28,6 +28,7 @@ import ( "github.com/jacobsa/fuse" "github.com/jacobsa/fuse/samples/cachingfs" "github.com/jacobsa/gcsfuse/timeutil" + . "github.com/jacobsa/oglematchers" . "github.com/jacobsa/ogletest" "golang.org/x/net/context" ) @@ -470,11 +471,13 @@ func (t *AttributeCachingTest) StatMtimeStat_ViaPath() { fooAfter, dirAfter, barAfter := t.statAll() // Since we don't have entry caching enabled, the call above had to look up - // the entry again. With the lookup we returned new attributes, so we expect - // that the mtime will be fresh. - ExpectThat(fooAfter.ModTime(), timeutil.TimeEq(newMtime)) - ExpectThat(dirAfter.ModTime(), timeutil.TimeEq(newMtime)) - ExpectThat(barAfter.ModTime(), timeutil.TimeEq(newMtime)) + // the entry again. With the lookup we returned new attributes, so it's + // possible that the mtime will be fresh. On Linux it appears to be, and on + // OS X it appears to not be. + m := AnyOf(timeutil.TimeEq(newMtime), timeutil.TimeEq(t.initialMtime)) + ExpectThat(fooAfter.ModTime(), m) + ExpectThat(dirAfter.ModTime(), m) + ExpectThat(barAfter.ModTime(), m) } func (t *AttributeCachingTest) StatMtimeStat_ViaFileDescriptor() {