diff --git a/seaweed-block/cmd/blockvolume/procedure_store_down_integration_test.go b/seaweed-block/cmd/blockvolume/procedure_store_down_integration_test.go index 4b5bf1d310..5f2e6297c9 100644 --- a/seaweed-block/cmd/blockvolume/procedure_store_down_integration_test.go +++ b/seaweed-block/cmd/blockvolume/procedure_store_down_integration_test.go @@ -7,6 +7,7 @@ import ( "context" "errors" "fmt" + "io/fs" "os" "path" "path/filepath" @@ -108,14 +109,20 @@ func storeDownDuringACut(t *testing.T, down string, cowBytes int64, cowWindow bo } return fmt.Sprintf("%s@%d", hd.Current, hd.Position) } + // sideBytes sums the copy-on-write side files anywhere under the host's + // root: a store lives in its volume's own directory (-), and + // its side file is created next to it. sideBytes := func() int64 { - files, _ := filepath.Glob(filepath.Join(env.hosts["s1"].root, "*.cut-cow-*")) var n int64 - for _, f := range files { - if st, err := os.Stat(f); err == nil { + _ = filepath.WalkDir(env.hosts["s1"].root, func(p string, d fs.DirEntry, err error) error { + if err != nil || d.IsDir() || !strings.Contains(d.Name(), ".cut-cow-") { + return nil + } + if st, err := os.Stat(p); err == nil { n += st.Size() } - } + return nil + }) return n }