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
test(s3/lifecycle): assert per-goroutine errors in fake-server concurrent test (#9393)
Chris Lu8cf42a5abb2a
diff --git a/weed/s3api/s3lifecycle/lifecycletest/fakeserver_test.go b/weed/s3api/s3lifecycle/lifecycletest/fakeserver_test.goindex ca9f2439fe..7eac54d7b4 100644--- a/weed/s3api/s3lifecycle/lifecycletest/fakeserver_test.go+++ b/weed/s3api/s3lifecycle/lifecycletest/fakeserver_test.go@@ -193,17 +193,25 @@ func TestFake_NilRequestUsesDefault(t *testing.T) {func TestFake_ConcurrentCallsSerializeWithoutDeadlock(t *testing.T) {// The dispatcher fans dispatch across many goroutines; the fake- // must not livelock or drop records under concurrent load.+ // must not livelock or drop records under concurrent load. Capture+ // each goroutine's err so a regression in concurrent paths surfaces+ // instead of being masked by length-only assertions.f := NewFakeLifecycleServer()const N = 64var wg sync.WaitGroup+ errCh := make(chan error, N)wg.Add(N)for i := 0; i < N; i++ {go func() {defer wg.Done()- _, _ = f.LifecycleDelete(context.Background(), &s3_lifecycle_pb.LifecycleDeleteRequest{Bucket: "b", ObjectPath: "k"})+ _, err := f.LifecycleDelete(context.Background(), &s3_lifecycle_pb.LifecycleDeleteRequest{Bucket: "b", ObjectPath: "k"})+ errCh <- err}()}wg.Wait()+ close(errCh)+ for err := range errCh {+ require.NoError(t, err)+ }assert.Len(t, f.Recorded(), N)}