generation-aware playback statuses
This commit is contained in:
@@ -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}}}
|
||||
|
||||
Reference in New Issue
Block a user