From beab7004f2556fec637ebe55a3aefad3d81c419f Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Fri, 2 Apr 2021 20:22:26 +0200 Subject: tests: sharedstorage: wait 100ms longer for cache expiry With 1.0 seconds we see failures on Travis, example: https://travis-ci.org/github/rfjakob/gocryptfs/builds/765648739 With 1.1 seconds it seems to always work. --- tests/sharedstorage/sharedstorage_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/sharedstorage/sharedstorage_test.go b/tests/sharedstorage/sharedstorage_test.go index 0fe7838..8f46c0d 100644 --- a/tests/sharedstorage/sharedstorage_test.go +++ b/tests/sharedstorage/sharedstorage_test.go @@ -14,7 +14,9 @@ import ( var flagSharestorage bool -const cacheTime = time.Second +// EntryTimeout is 1 second, give the kernel 1.1 second to actually +// expire an entry. The tests fail sometime with 1.0 second! +const waitForExpire = time.Second + 100*time.Millisecond func TestMain(m *testing.M) { ret := 0 @@ -87,7 +89,7 @@ func TestDirUnlink(t *testing.T) { t.Fatal(err) } else { // Must always work after cache timeout - time.Sleep(cacheTime) + time.Sleep(waitForExpire) if err := unix.Unlink(tc.mnt1 + "/foo"); err != nil { t.Fatal(err) } @@ -129,7 +131,7 @@ func TestStaleHardlinks(t *testing.T) { t.Fatal(err) } else { // Must always work after cache timeout - time.Sleep(cacheTime) + time.Sleep(waitForExpire) fd, err = unix.Open(link0, unix.O_RDONLY, 0) if err != nil { t.Fatal(err) -- cgit v1.2.3