Skip to content

Commit

Permalink
Wait for mounting in Windows tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalif committed Jun 19, 2023
1 parent 5bf3c5e commit 7f03a30
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions internal/goofys_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package internal

import (
"os"
"time"
. "gopkg.in/check.v1"
)

Expand All @@ -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
}

Expand Down

0 comments on commit 7f03a30

Please sign in to comment.