generation-aware playback statuses

This commit is contained in:
Dmitry Sergeev
2026-09-01 18:03:18 +03:00
parent 7a19fe0dad
commit 9bc08109fc
12 changed files with 210 additions and 41 deletions
+22
View File
@@ -151,6 +151,28 @@ func TestVideoWorkerRejectsInactiveFeed(t *testing.T) {
}
}
func TestVideoWorkerStatusesInheritGeneration(t *testing.T) {
openErr := errors.New("unavailable")
var statuses []Status
worker := newTestVideoWorker(
t,
&scriptedVideoFactory{results: []videoOpenResult{{err: openErr}}},
&fakeVideoSink{},
1,
func(error) bool { return true },
func(status Status) { statuses = append(statuses, status) },
)
_ = worker.Run(withGeneration(context.Background(), 7), activeVideoConfig())
if len(statuses) == 0 {
t.Fatal("no statuses emitted")
}
for _, status := range statuses {
if status.Generation != 7 {
t.Fatalf("status generation = %d, want 7: %+v", status.Generation, status)
}
}
}
func TestVideoWorkerExhaustsOpenRetries(t *testing.T) {
openErr := errors.New("producer unavailable")
factory := &scriptedVideoFactory{