From ccbec4f2733853ad5d1f3b63dfb0913f092d6ca1 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Sat, 5 Dec 2026 22:52:17 -0800 Subject: [PATCH] test(block): the chunk-size guard has a control spec that must pass Co-Authored-By: Claude Opus 5.5 --- seaweed-block/core/lifecycle/snapshot_delete_cap_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/seaweed-block/core/lifecycle/snapshot_delete_cap_test.go b/seaweed-block/core/lifecycle/snapshot_delete_cap_test.go index 5e3210bae6..86bd9f6259 100644 --- a/seaweed-block/core/lifecycle/snapshot_delete_cap_test.go +++ b/seaweed-block/core/lifecycle/snapshot_delete_cap_test.go @@ -20,7 +20,12 @@ func TestLargestCreatableVolumeFitsOneSnapshotDelete(t *testing.T) { if chunkBytes == 0 { t.Fatal("no default chunk size") } - if err := validateSpec(normalizeVolumeSpec(VolumeSpec{VolumeID: "v1", SizeBytes: 1 << 30, ReplicationFactor: 1, ChunkBytes: chunkBytes / 2})); err == nil { + spec := VolumeSpec{VolumeID: "v1", SizeBytes: 1 << 30, ReplicationFactor: 1} + if err := validateSpec(normalizeVolumeSpec(spec)); err != nil { + t.Fatalf("the control spec is refused, so the chunk-size check below proves nothing: %v", err) + } + spec.ChunkBytes = chunkBytes / 2 + if err := validateSpec(normalizeVolumeSpec(spec)); err == nil { t.Fatal("a smaller chunk size is accepted: the largest chunk count is no longer at the default chunk size") } capacity := uint64(layout.MaxListPages) * uint64(layout.MaxListPageEntries)