aboutsummaryrefslogtreecommitdiff
path: root/tests/reverse/ctlsock_test.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2019-01-01 22:54:41 +0100
committerJakob Unterwurzacher2019-01-02 00:09:17 +0100
commit035b3367b7a447adc5e4c1ed96706f911c08c9f8 (patch)
tree1698bdd5ef6cfd638202db3adde6dfb1d5a4e158 /tests/reverse/ctlsock_test.go
parent035834dd5115cf5384e61dccfd2acc488990468f (diff)
tests: reverse: add ctlsocket cleanup delay
Diffstat (limited to 'tests/reverse/ctlsock_test.go')
-rw-r--r--tests/reverse/ctlsock_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/reverse/ctlsock_test.go b/tests/reverse/ctlsock_test.go
index 6ccc724..6991f4f 100644
--- a/tests/reverse/ctlsock_test.go
+++ b/tests/reverse/ctlsock_test.go
@@ -4,6 +4,7 @@ import (
"io/ioutil"
"syscall"
"testing"
+ "time"
"github.com/rfjakob/gocryptfs/internal/ctlsock"
"github.com/rfjakob/gocryptfs/tests/test_helpers"
@@ -67,6 +68,9 @@ 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
@@ -85,4 +89,7 @@ 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)
}