test(block): the chunk-size guard has a control spec that must pass

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
pingqiuandClaude Opus 5.5 committed 2026-12-05 22:52:17 -08:00
1 parent c9481250c5
commit ccbec4f273
1 file changed
+6 -1
@@ -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)