summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2019-01-02 21:03:26 +0100
committerJakob Unterwurzacher2019-01-02 21:03:26 +0100
commit59f1300591d44b1e5d8187b54951c03d6120289f (patch)
tree1a1c0c801a7af8792af9dc94e25bb11d94c00010
parentacccfa60d6a1f4fd650039d64cba8156a70de8cf (diff)
tests: retry longer when we see a fd leak
Hopefully gets rid of the false positives on travis.
-rw-r--r--tests/test_helpers/mount_unmount.go14
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/test_helpers/mount_unmount.go b/tests/test_helpers/mount_unmount.go
index cce763a..8ba96ec 100644
--- a/tests/test_helpers/mount_unmount.go
+++ b/tests/test_helpers/mount_unmount.go
@@ -140,13 +140,17 @@ func UnmountErr(dir string) (err error) {
// Retry a few times to hide that problem.
for i := 1; i <= max; i++ {
if pid > 0 {
- fdsNow = ListFds(pid)
- if len(fdsNow) > len(fds) {
+ for j := 1; j <= max; j++ {
// File close on FUSE is asynchronous, closing a socket
- // when testing -ctlsock as well. Wait one extra millisecond
- // and hope that all close commands get through to the gocryptfs
+ // when testing "-ctlsock" is as well. Wait a little and
+ // hope that all close commands get through to the gocryptfs
// process.
- time.Sleep(1 * time.Millisecond)
+ fdsNow = ListFds(pid)
+ if len(fdsNow) <= len(fds) {
+ break
+ }
+ fmt.Printf("UnmountErr: fdsOld=%d fdsNow=%d, retrying\n", len(fds), len(fdsNow))
+ time.Sleep(10 * time.Millisecond)
fdsNow = ListFds(pid)
}
}