From 28fcc53e457f1925c6bf4e87b8f57fc2dbf3b680 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 13 Jun 2017 10:52:10 +0100 Subject: [PATCH] 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. --- cmd/mountlib/mounttest/fs.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/mountlib/mounttest/fs.go b/cmd/mountlib/mounttest/fs.go index 5eb024195..b80e3fd3e 100644 --- a/cmd/mountlib/mounttest/fs.go +++ b/cmd/mountlib/mounttest/fs.go @@ -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) }