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
package topology
import (
"context"
"errors"
"testing"
"github.com/seaweedfs/seaweedfs/weed/stats"
)
func TestClassifyReplicationError(t *testing.T) {
tests := []struct {
name string
err error
want string
}{
{"deadline exceeded", context.DeadlineExceeded, stats.FailureTimeout},
{"context cancelled", context.Canceled, stats.FailureContextCancelled},
{"connection refused", errors.New("connection refused"), stats.FailureConnectionRefused},
{"generic error", errors.New("internal server error"), stats.FailureServerError},
{"nil error", nil, ""},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got := classifyReplicationError(tt.err)
if got != tt.want {
t.Errorf("classifyReplicationError() = %q, want %q", got, tt.want)
}
})
}
}