Add sync before unmount on snapshotter layer test

Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
Derek McGowan 2023-05-13 00:11:04 -07:00
parent b729962e3e
commit 1be571b14f
No known key found for this signature in database
GPG Key ID: F58C5D0A4405ACDB
3 changed files with 12 additions and 1 deletions

View File

@ -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) t.Fatalf("[layer %d] preparing doesn't equal to flat after apply: %+v", i, err)
} }
sync()
testutil.Unmount(t, preparing) testutil.Unmount(t, preparing)
parent = filepath.Join(work, fmt.Sprintf("committed-%d", i)) parent = filepath.Join(work, fmt.Sprintf("committed-%d", i))

View File

@ -18,7 +18,11 @@
package testsuite package testsuite
import "syscall" import (
"syscall"
"golang.org/x/sys/unix"
)
func clearMask() func() { func clearMask() func() {
oldumask := syscall.Umask(0) oldumask := syscall.Umask(0)
@ -26,3 +30,7 @@ func clearMask() func() {
syscall.Umask(oldumask) syscall.Umask(oldumask)
} }
} }
func sync() {
unix.Sync()
}

View File

@ -19,3 +19,5 @@ package testsuite
func clearMask() func() { func clearMask() func() {
return func() {} return func() {}
} }
func sync() {}