summaryrefslogtreecommitdiff
path: root/tests/reverse
diff options
context:
space:
mode:
authorJakob Unterwurzacher2019-01-02 01:09:09 +0100
committerJakob Unterwurzacher2019-01-02 01:09:09 +0100
commit772afa93f98aa77959995e42564b898057c59b87 (patch)
tree974b667fb481b87ef4ea6f2375d2dc7c48fd12fe /tests/reverse
parent5aa1755cbc55d17a5b4b71faa1e0bba34fe83d8b (diff)
tests: add fd leak retry logic to UnmountErr, really return error
Give the gocryptfs process one extra millisecond to close files. Allows us to drop several other sleeps. UnmountErr now really returns an error when it detects an fd leak instead of just printing a message.
Diffstat (limited to 'tests/reverse')
-rw-r--r--tests/reverse/ctlsock_test.go7
-rw-r--r--tests/reverse/exclude_test.go4
2 files changed, 0 insertions, 11 deletions
diff --git a/tests/reverse/ctlsock_test.go b/tests/reverse/ctlsock_test.go
index 6991f4f..6ccc724 100644
--- a/tests/reverse/ctlsock_test.go
+++ b/tests/reverse/ctlsock_test.go
@@ -4,7 +4,6 @@ import (
"io/ioutil"
"syscall"
"testing"
- "time"
"github.com/rfjakob/gocryptfs/internal/ctlsock"
"github.com/rfjakob/gocryptfs/tests/test_helpers"
@@ -68,9 +67,6 @@ func TestCtlSockPathOps(t *testing.T) {
if response.ErrNo != int32(syscall.ENOENT) {
t.Errorf("File should not exist: ErrNo=%d ErrText=%s", response.ErrNo, response.ErrText)
}
- // Give the running gocryptfs process a little bit of time to close lingering
- // sockets. Avoid triggering the FD leak detector.
- time.Sleep(1 * time.Millisecond)
}
// We should not panic when somebody feeds requests that make no sense
@@ -89,7 +85,4 @@ func TestCtlSockCrash(t *testing.T) {
// Try to crash it
req := ctlsock.RequestStruct{DecryptPath: "gocryptfs.longname.XXX_TestCtlSockCrash_XXX.name"}
test_helpers.QueryCtlSock(t, sock, req)
- // Give the running gocryptfs process a little bit of time to close lingering
- // sockets. Avoid triggering the FD leak detector.
- time.Sleep(1 * time.Millisecond)
}
diff --git a/tests/reverse/exclude_test.go b/tests/reverse/exclude_test.go
index c1b2180..aaecd65 100644
--- a/tests/reverse/exclude_test.go
+++ b/tests/reverse/exclude_test.go
@@ -3,7 +3,6 @@ package reverse_test
import (
"io/ioutil"
"testing"
- "time"
"github.com/rfjakob/gocryptfs/internal/ctlsock"
"github.com/rfjakob/gocryptfs/tests/test_helpers"
@@ -102,9 +101,6 @@ func testExclude(t *testing.T, flag string) {
t.Errorf("File %q / %q is hidden, but should be visible", pOk[i], v)
}
}
- // Give the running gocryptfs process a little bit of time to close lingering
- // sockets. Avoid triggering the FD leak detector.
- time.Sleep(1 * time.Millisecond)
}
func TestExclude(t *testing.T) {