tests: fix race condition in HLS tests

This commit is contained in:
aler9
2023-01-07 16:08:34 +01:00
parent b18d30914d
commit d0e8d00616
-9
View File
@@ -425,12 +425,6 @@ func TestClientInvalidSequenceID(t *testing.T) {
require.NoError(t, err)
defer s.close()
packetRecv := make(chan struct{})
onH264 := func(pts time.Duration, dat interface{}) {
close(packetRecv)
}
c, err := NewClient(
"http://localhost:5780/stream.m3u8",
"",
@@ -439,14 +433,11 @@ func TestClientInvalidSequenceID(t *testing.T) {
require.NoError(t, err)
c.OnTracks(func(tracks []format.Format) error {
c.OnData(tracks[0], onH264)
return nil
})
c.Start()
<-packetRecv
err = <-c.Wait()
require.EqualError(t, err, "following segment not found or not ready yet")