Browse Source

tests: fix race condition in HLS tests

pull/1377/head
aler9 3 years ago
parent
commit
d0e8d00616
  1. 9
      internal/hls/client_test.go

9
internal/hls/client_test.go

@ -425,12 +425,6 @@ func TestClientInvalidSequenceID(t *testing.T) { @@ -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) { @@ -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")

Loading…
Cancel
Save