From 7f03a30742d422b36ea30afc10c722403084e50b Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Mon, 19 Jun 2023 18:10:26 +0300 Subject: [PATCH] Wait for mounting in Windows tests --- internal/goofys_windows_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/internal/goofys_windows_test.go b/internal/goofys_windows_test.go index 36ab6700..992178db 100644 --- a/internal/goofys_windows_test.go +++ b/internal/goofys_windows_test.go @@ -21,6 +21,7 @@ package internal import ( "os" + "time" . "gopkg.in/check.v1" ) @@ -33,8 +34,19 @@ func (s *GoofysTest) SetUpSuite(t *C) { func (s *GoofysTest) mountCommon(t *C, mountPoint string, sameProc bool) { os.Remove(mountPoint) + s.fs.flags.MountPoint = mountPoint mfs, err := mountFuseFS(s.fs) t.Assert(err, IsNil) + // WinFSP doesn't wait for mounting correctly... Try to wait ourselves + for i := 0; i < 20; i++ { + _, err = os.Stat(mountPoint) + if err != nil { + time.Sleep(time.Second) + } else { + break + } + } + t.Assert(err, IsNil) s.mfs = mfs }