test: write more files than the master grows volumes at a time (#11131)

The cached-location test needs two files on one volume, but it wrote six
files into the six volumes a 001 layout starts with, and every so often
each file landed on its own volume and the test had nothing to probe.
Seven files leave no way to spread them out.

Claude-Session: https://claude.ai/code/session_011NYXuzGttwrTMsfLYvmQFs
This commit is contained in:
Chris Lu
2026-09-03 10:29:35 -07:00
committed by GitHub
parent 59916d8978
commit 52db7a6aee
+4 -2
View File
@@ -215,10 +215,12 @@ func TestReadAfterCachedLocationDies(t *testing.T) {
c := startFailoverCluster(t, 3, 2)
// Small files so each is a single chunk on a single volume, which keeps the
// mapping from file to server unambiguous.
// mapping from file to server unambiguous. The master grows six 001 volumes
// at a time, so seven files put two of them on one volume however the
// writes are spread.
const fileSize = 256 << 10
payloads := make(map[string][]byte)
for i := 0; i < 6; i++ {
for i := 0; i < 7; i++ {
name := fmt.Sprintf("smallfile-%d", i)
data := make([]byte, fileSize)
_, err := rand.Read(data)