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
+23
View File
@@ -126,6 +126,29 @@ func TestSyncWorkerRejectsInvalidOrInactiveFeeds(t *testing.T) {
}
}
func TestSyncWorkerStatusesInheritGeneration(t *testing.T) {
openErr := errors.New("unavailable")
var statuses []Status
worker := newTestSyncWorker(
t,
&scriptedSyncFactory{results: []syncOpenResult{{err: openErr}}},
&fakeVideoSink{},
&fakeAudioSink{},
1,
func(status Status) { statuses = append(statuses, status) },
)
video, audio := activeSyncConfigs()
_ = worker.Run(withGeneration(context.Background(), 9), video, audio)
if len(statuses) == 0 {
t.Fatal("no statuses emitted")
}
for _, status := range statuses {
if status.Generation != 9 {
t.Fatalf("status generation = %d, want 9: %+v", status.Generation, status)
}
}
}
func TestSyncWorkerExhaustsOpenRetries(t *testing.T) {
openErr := errors.New("sync producer unavailable")
factory := &scriptedSyncFactory{results: []syncOpenResult{{err: openErr}, {err: openErr}}}