mount test: retry umount as it fails occasionally

This is because of the background releasing of files which happens
after all the files are closed.
This commit is contained in:
Nick Craig-Wood 2017-06-13 10:52:10 +01:00
parent 2ca477c57f
commit 28fcc53e45

View File

@ -13,6 +13,7 @@ import (
"runtime"
"strings"
"testing"
"time"
"github.com/ncw/rclone/cmd/mountlib"
"github.com/ncw/rclone/fs"
@ -156,6 +157,11 @@ func (r *Run) umount() {
*/
log.Printf("Unmounting %q", r.mountPath)
err := r.umountFn()
if err != nil {
log.Printf("signal to umount failed - retrying: %v", err)
time.Sleep(3 * time.Second)
err = r.umountFn()
}
if err != nil {
log.Fatalf("signal to umount failed: %v", err)
}