From 2bcf65741f15f786e0cc95346fd2e0ab031f1156 Mon Sep 17 00:00:00 2001 From: chrislu Date: Sun, 26 Oct 2025 19:13:33 -0700 Subject: [PATCH] 10GB sparse files can be slow or fail on non-sparse FS. Use 10MB to hit SmallBlockSize math (1MB shards) deterministically. --- weed/storage/disk_location_ec_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/weed/storage/disk_location_ec_test.go b/weed/storage/disk_location_ec_test.go index fad1612fa..e0e34cee4 100644 --- a/weed/storage/disk_location_ec_test.go +++ b/weed/storage/disk_location_ec_test.go @@ -114,8 +114,8 @@ func TestIncompleteEcEncodingCleanup(t *testing.T) { // Setup test files baseFileName := erasure_coding.EcShardFileName(tt.collection, tempDir, int(tt.volumeId)) - // Use deterministic sizes that match EC encoding - datFileSize := int64(10 * 1024 * 1024 * 1024) // 10GB + // Use deterministic but small size: 10MB .dat => 1MB per shard + datFileSize := int64(10 * 1024 * 1024) // 10MB expectedShardSize := calculateExpectedShardSize(datFileSize) // Create .dat file if needed @@ -294,9 +294,9 @@ func TestValidateEcVolume(t *testing.T) { // For proper testing, we need to use realistic sizes that match EC encoding // EC uses large blocks (1GB) and small blocks (1MB) - // For test purposes, use a .dat file size that results in expected shard sizes - // 10GB .dat file = 1GB per shard (1 large block) - datFileSize := int64(10 * 1024 * 1024 * 1024) // 10GB + // For test purposes, use a small .dat file size that still exercises the logic + // 10MB .dat file = 1MB per shard (one small batch, fast and deterministic) + datFileSize := int64(10 * 1024 * 1024) // 10MB expectedShardSize := calculateExpectedShardSize(datFileSize) // Create .dat file if needed