aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-04-02 20:22:26 +0200
committerJakob Unterwurzacher2021-04-02 20:22:26 +0200
commitbeab7004f2556fec637ebe55a3aefad3d81c419f (patch)
treee334250a12464619770f6a81cf359413dc39885d
parent688373c9264495c7fa71381ca740c7473b496cd7 (diff)
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.
-rw-r--r--tests/sharedstorage/sharedstorage_test.go8
1 files 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)