SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
fix(test): remove flaky shard ID assertion in EC scrub test (#8978)
Chris Lu6098ef4bd30b
diff --git a/test/volume_server/grpc/scrub_integration_test.go b/test/volume_server/grpc/scrub_integration_test.goindex e45ed503f8..5b8da8af40 100644--- a/test/volume_server/grpc/scrub_integration_test.go+++ b/test/volume_server/grpc/scrub_integration_test.go@@ -27,9 +27,9 @@ func TestScrubVolumeFullHealthy(t *testing.T) {framework.AllocateVolume(t, grpcClient, volumeID, "")httpClient := framework.NewHTTPClient()- framework.UploadBytes(t, httpClient, clusterHarness.VolumeAdminURL(), framework.NewFileID(volumeID, 1, 1), []byte("data-one"))- framework.UploadBytes(t, httpClient, clusterHarness.VolumeAdminURL(), framework.NewFileID(volumeID, 2, 2), []byte("data-two"))- framework.UploadBytes(t, httpClient, clusterHarness.VolumeAdminURL(), framework.NewFileID(volumeID, 3, 3), []byte("data-three"))+ framework.ReadAllAndClose(t, framework.UploadBytes(t, httpClient, clusterHarness.VolumeAdminURL(), framework.NewFileID(volumeID, 1, 1), []byte("data-one")))+ framework.ReadAllAndClose(t, framework.UploadBytes(t, httpClient, clusterHarness.VolumeAdminURL(), framework.NewFileID(volumeID, 2, 2), []byte("data-two")))+ framework.ReadAllAndClose(t, framework.UploadBytes(t, httpClient, clusterHarness.VolumeAdminURL(), framework.NewFileID(volumeID, 3, 3), []byte("data-three")))ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)defer cancel()@@ -65,7 +65,7 @@ func TestScrubVolumeFullCorruptData(t *testing.T) {framework.AllocateVolume(t, grpcClient, volumeID, "")httpClient := framework.NewHTTPClient()- framework.UploadBytes(t, httpClient, clusterHarness.VolumeAdminURL(), framework.NewFileID(volumeID, 1, 1), []byte("important data"))+ framework.ReadAllAndClose(t, framework.UploadBytes(t, httpClient, clusterHarness.VolumeAdminURL(), framework.NewFileID(volumeID, 1, 1), []byte("important data")))framework.CorruptDatFile(t, clusterHarness.BaseDir(), volumeID)@@ -102,8 +102,8 @@ func TestScrubVolumeMixedHealthy(t *testing.T) {framework.AllocateVolume(t, grpcClient, corruptVol, "")httpClient := framework.NewHTTPClient()- framework.UploadBytes(t, httpClient, clusterHarness.VolumeAdminURL(), framework.NewFileID(healthyVol, 1, 1), []byte("healthy"))- framework.UploadBytes(t, httpClient, clusterHarness.VolumeAdminURL(), framework.NewFileID(corruptVol, 1, 1), []byte("will corrupt"))+ framework.ReadAllAndClose(t, framework.UploadBytes(t, httpClient, clusterHarness.VolumeAdminURL(), framework.NewFileID(healthyVol, 1, 1), []byte("healthy")))+ framework.ReadAllAndClose(t, framework.UploadBytes(t, httpClient, clusterHarness.VolumeAdminURL(), framework.NewFileID(corruptVol, 1, 1), []byte("will corrupt")))framework.CorruptIndexFile(t, clusterHarness.BaseDir(), corruptVol)@@ -245,8 +245,8 @@ func TestScrubEcVolumeLocalHealthy(t *testing.T) {if resp.GetTotalVolumes() != 1 {t.Fatalf("expected total_volumes=1, got %d", resp.GetTotalVolumes())}- if resp.GetTotalFiles() < 1 {- t.Fatalf("expected at least 1 file, got %d", resp.GetTotalFiles())+ if resp.GetTotalFiles() != 1 {+ t.Fatalf("expected total_files=1, got %d", resp.GetTotalFiles())}if len(resp.GetBrokenVolumeIds()) != 0 {t.Fatalf("expected no broken volumes, got %v: %v", resp.GetBrokenVolumeIds(), resp.GetDetails())@@ -288,17 +288,12 @@ func TestScrubEcVolumeLocalCorruptShard(t *testing.T) {if len(resp.GetBrokenShardInfos()) == 0 {t.Fatalf("expected broken shard info after shard corruption")}- // Verify the reported broken shard is shard 0.- foundShard0 := false+ // Verify all reported broken shards belong to the corrupted volume.for _, si := range resp.GetBrokenShardInfos() {- if si.GetShardId() == 0 {- foundShard0 = true- break+ if si.GetVolumeId() != volumeID {+ t.Fatalf("broken shard info for unexpected volume %d, want %d", si.GetVolumeId(), volumeID)}}- if !foundShard0 {- t.Fatalf("expected shard 0 in broken shard infos, got %v", resp.GetBrokenShardInfos())- }}func TestScrubEcVolumeAutoSelectWithEcPresent(t *testing.T) {