Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
561 B · 25 lines
1234567891011121314151617181920212223242526package media
import ( "context" "fmt" "testing"
"github.com/stretchr/testify/require" "stream.place/streamplace/pkg/localdb")
// Validated segments reach a subscriber in validation order.func TestNewSegmentFanoutKeepsOrder(t *testing.T) { mm := &MediaManager{} ch := mm.NewSegment() const n = 200 go func() { for i := 0; i < n; i++ { mm.notifySubscribers(context.Background(), &NewSegmentNotification{Segment: &localdb.Segment{ID: fmt.Sprint(i)}}) } }() for i := 0; i < n; i++ { require.Equal(t, fmt.Sprint(i), (<-ch).Segment.ID) }}