From 4426d07ba4e4188102c908eef00f0ba862964cb7 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Mon, 30 Nov 2026 21:44:33 -0800 Subject: [PATCH] test: the store-down test finds copy-on-write side files under the volume's directory A store now lives in its volume's own directory (-) and its side file is created next to it; the test globbed only the host root, so it measured 0 and its no-leftover checks looked nowhere. It walks the root. Co-Authored-By: Claude Opus 5.5 --- .../procedure_store_down_integration_test.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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 }