Retry umount for integration tests

This commit is contained in:
Alexander Neumann 2016-09-15 21:32:15 +02:00
parent 9add72e9d6
commit d4a2d70089

View file

@ -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 {