forked from TrueCloudLab/rclone
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:
parent
2ca477c57f
commit
28fcc53e45
1 changed files with 6 additions and 0 deletions
|
@ -13,6 +13,7 @@ import (
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/ncw/rclone/cmd/mountlib"
|
"github.com/ncw/rclone/cmd/mountlib"
|
||||||
"github.com/ncw/rclone/fs"
|
"github.com/ncw/rclone/fs"
|
||||||
|
@ -156,6 +157,11 @@ func (r *Run) umount() {
|
||||||
*/
|
*/
|
||||||
log.Printf("Unmounting %q", r.mountPath)
|
log.Printf("Unmounting %q", r.mountPath)
|
||||||
err := r.umountFn()
|
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 {
|
if err != nil {
|
||||||
log.Fatalf("signal to umount failed: %v", err)
|
log.Fatalf("signal to umount failed: %v", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue