diff --git a/snapshots/testsuite/testsuite.go b/snapshots/testsuite/testsuite.go index 36982adab..7afbd953e 100644 --- a/snapshots/testsuite/testsuite.go +++ b/snapshots/testsuite/testsuite.go @@ -959,6 +959,7 @@ func check128LayersMount(name string) func(ctx context.Context, t *testing.T, sn t.Fatalf("[layer %d] preparing doesn't equal to flat after apply: %+v", i, err) } + sync() testutil.Unmount(t, preparing) parent = filepath.Join(work, fmt.Sprintf("committed-%d", i)) diff --git a/snapshots/testsuite/testsuite_unix.go b/snapshots/testsuite/testsuite_unix.go index 46a974b71..8a274ce24 100644 --- a/snapshots/testsuite/testsuite_unix.go +++ b/snapshots/testsuite/testsuite_unix.go @@ -18,7 +18,11 @@ package testsuite -import "syscall" +import ( + "syscall" + + "golang.org/x/sys/unix" +) func clearMask() func() { oldumask := syscall.Umask(0) @@ -26,3 +30,7 @@ func clearMask() func() { syscall.Umask(oldumask) } } + +func sync() { + unix.Sync() +} diff --git a/snapshots/testsuite/testsuite_windows.go b/snapshots/testsuite/testsuite_windows.go index a3cb82fbf..382a85978 100644 --- a/snapshots/testsuite/testsuite_windows.go +++ b/snapshots/testsuite/testsuite_windows.go @@ -19,3 +19,5 @@ package testsuite func clearMask() func() { return func() {} } + +func sync() {}