From d4a2d7008920035676407d4ea879d3ccf18139a6 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 15 Sep 2016 21:32:15 +0200 Subject: [PATCH] Retry umount for integration tests --- src/cmds/restic/integration_fuse_test.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/cmds/restic/integration_fuse_test.go b/src/cmds/restic/integration_fuse_test.go index 396b7d167..bfaeaf0a3 100644 --- a/src/cmds/restic/integration_fuse_test.go +++ b/src/cmds/restic/integration_fuse_test.go @@ -60,7 +60,18 @@ func mount(t testing.TB, global GlobalOptions, dir string) { func umount(t testing.TB, global GlobalOptions, dir string) { cmd := &CmdMount{global: &global} - OK(t, cmd.Umount(dir)) + + var err error + for i := 0; i < mountWait; i++ { + if err = cmd.Umount(dir); err == nil { + t.Logf("directory %v umounted", dir) + return + } + + time.Sleep(mountSleep) + } + + t.Errorf("unable to umount dir %v, last error was: %v", dir, err) } func listSnapshots(t testing.TB, dir string) []string {