aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2019-01-04 23:50:01 +0100
committerJakob Unterwurzacher2019-01-04 23:50:01 +0100
commit65eded4a229c52258054f7d4e710beb02aedfe93 (patch)
tree347653f4da7a9d0b93a371f2e0c103f682dd1e31
parentc32066c5b0ae716ba43999bf808c5baa7e08edd0 (diff)
tests: bump maxCacheFds to 3
As the dirCache now has 3 entries, the tests should accept up to 3 extra fds without declaring an fd leak.
-rw-r--r--internal/fusefrontend/dircache.go2
-rw-r--r--tests/test_helpers/mount_unmount.go4
2 files changed, 5 insertions, 1 deletions
diff --git a/internal/fusefrontend/dircache.go b/internal/fusefrontend/dircache.go
index 7e80ddc..5c8b760 100644
--- a/internal/fusefrontend/dircache.go
+++ b/internal/fusefrontend/dircache.go
@@ -14,6 +14,8 @@ import (
const (
// Number of entries in the dirCache. Three entries work well for two
// (probably also three) parallel tar extracts (hit rate around 92%).
+ // Keen in sync with test_helpers.maxCacheFds !
+ // TODO: How to share this constant without causing in import cycle?
dirCacheSize = 3
// Enable Lookup/Store/Clear debug messages
enableDebugMessages = false
diff --git a/tests/test_helpers/mount_unmount.go b/tests/test_helpers/mount_unmount.go
index 39f7c77..0a3bc1b 100644
--- a/tests/test_helpers/mount_unmount.go
+++ b/tests/test_helpers/mount_unmount.go
@@ -123,7 +123,9 @@ func UnmountPanic(dir string) {
}
// gocryptfs may hold up to maxCacheFds open for caching
-const maxCacheFds = 1
+// Keen in sync with fusefrontend.dirCacheSize
+// TODO: How to share this constant without causing in import cycle?!
+const maxCacheFds = 3
// UnmountErr tries to unmount "dir", retrying 10 times, and returns the
// resulting error.