Skip to content

Commit 1be571b

Browse files
committed
Add sync before unmount on snapshotter layer test
Signed-off-by: Derek McGowan <[email protected]>
1 parent b729962 commit 1be571b

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

snapshots/testsuite/testsuite.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,7 @@ func check128LayersMount(name string) func(ctx context.Context, t *testing.T, sn
959959
t.Fatalf("[layer %d] preparing doesn't equal to flat after apply: %+v", i, err)
960960
}
961961

962+
sync()
962963
testutil.Unmount(t, preparing)
963964

964965
parent = filepath.Join(work, fmt.Sprintf("committed-%d", i))

snapshots/testsuite/testsuite_unix.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,19 @@
1818

1919
package testsuite
2020

21-
import "syscall"
21+
import (
22+
"syscall"
23+
24+
"golang.org/x/sys/unix"
25+
)
2226

2327
func clearMask() func() {
2428
oldumask := syscall.Umask(0)
2529
return func() {
2630
syscall.Umask(oldumask)
2731
}
2832
}
33+
34+
func sync() {
35+
unix.Sync()
36+
}

snapshots/testsuite/testsuite_windows.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ package testsuite
1919
func clearMask() func() {
2020
return func() {}
2121
}
22+
23+
func sync() {}

0 commit comments

Comments
 (0)