Skip to content

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.

846 B
Raw Blame
package filer

import (
	"context"
	"testing"

	"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
	"github.com/stretchr/testify/assert"
)

// Stream preparation must fail when chunk manifest resolution fails, instead of serving a zero-filled stream.
func TestPrepareStreamContent_ManifestResolveFailure(t *testing.T) {
	master := &testMasterClient{}

	chunks := []*filer_pb.FileChunk{
		{FileId: "1,1879011dc64abd40", IsChunkManifest: true, Offset: 0, Size: 1 << 20},
	}

	_, err := PrepareStreamContentWithThrottler(context.Background(), master, noopJwt, chunks, 0, 1<<20, 0)
	assert.Error(t, err)
	assert.Contains(t, err.Error(), "fail to read manifest")

	_, err = PrepareStreamContentWithPrefetch(context.Background(), master, noopJwt, chunks, 0, 1<<20, 0, 4)
	assert.Error(t, err)
	assert.Contains(t, err.Error(), "fail to read manifest")
}