From ce2ca830aeb18d865cc6ac65664ed2ed2edfa4aa Mon Sep 17 00:00:00 2001 From: pingqiu Date: Sun, 22 Nov 2026 17:09:03 -0800 Subject: [PATCH] test: F1 blocks are exactly 4096 bytes Co-Authored-By: Claude Opus 5.5 --- .../blockvolume/snapshot_ladder_f1_integration_test.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/seaweed-block/cmd/blockvolume/snapshot_ladder_f1_integration_test.go b/seaweed-block/cmd/blockvolume/snapshot_ladder_f1_integration_test.go index 5205d5e591..1189e7b31d 100644 --- a/seaweed-block/cmd/blockvolume/snapshot_ladder_f1_integration_test.go +++ b/seaweed-block/cmd/blockvolume/snapshot_ladder_f1_integration_test.go @@ -236,8 +236,15 @@ func f1Restore(t *testing.T, env *handoffEnv, src, snap, target string) *daemon return d } +// f1Block is one deterministic 4096-byte block (pattern needs a length that +// divides 4096; these labels do not, so the block is filled explicitly). func f1Block(vol string, round int, kind string, lba uint64) []byte { - return pattern(fmt.Sprintf("%s r%d %s %08d|", vol, round, kind, lba)) + s := fmt.Sprintf("%s r%d %s %08d|", vol, round, kind, lba) + b := make([]byte, 4096) + for i := range b { + b[i] = s[i%len(s)] + } + return b } func f1LedgerBase(cfg f1Config, round int) uint64 {