tests: retry longer when we see a fd leak
Hopefully gets rid of the false positives on travis.
This commit is contained in:
parent
acccfa60d6
commit
59f1300591
@ -140,13 +140,17 @@ func UnmountErr(dir string) (err error) {
|
|||||||
// Retry a few times to hide that problem.
|
// Retry a few times to hide that problem.
|
||||||
for i := 1; i <= max; i++ {
|
for i := 1; i <= max; i++ {
|
||||||
if pid > 0 {
|
if pid > 0 {
|
||||||
fdsNow = ListFds(pid)
|
for j := 1; j <= max; j++ {
|
||||||
if len(fdsNow) > len(fds) {
|
|
||||||
// File close on FUSE is asynchronous, closing a socket
|
// File close on FUSE is asynchronous, closing a socket
|
||||||
// when testing -ctlsock as well. Wait one extra millisecond
|
// when testing "-ctlsock" is as well. Wait a little and
|
||||||
// and hope that all close commands get through to the gocryptfs
|
// hope that all close commands get through to the gocryptfs
|
||||||
// process.
|
// 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)
|
fdsNow = ListFds(pid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user