Skip to content

Commit

Permalink
fix TestSegmenter unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
darkdarkdragon committed Dec 30, 2021
1 parent 2120352 commit c6b109e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions segmenter/video_segmenter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ import (
"strings"

"github.com/golang/glog"
"github.com/livepeer/lpms/ffmpeg"
"github.com/livepeer/lpms/stream"
"github.com/livepeer/lpms/vidplayer"
"github.com/livepeer/m3u8"
"github.com/livepeer/joy4/av"
"github.com/livepeer/joy4/av/avutil"
"github.com/livepeer/joy4/format"
"github.com/livepeer/joy4/format/rtmp"
"github.com/livepeer/lpms/ffmpeg"
"github.com/livepeer/lpms/stream"
"github.com/livepeer/lpms/vidplayer"
"github.com/livepeer/m3u8"
)

type TestStream struct{}
Expand Down Expand Up @@ -60,6 +60,12 @@ func (s *TestStream) ReadRTMPFromStream(ctx context.Context, dst av.MuxCloser) (
dst.WriteTrailer()
eof <- struct{}{}
}
// this sends data through TCP connection
// during the process OS tries to negotiate bigger TCP windows
// and that leads to connection being reset and unit test fails
// because of that
// so slow down transfer a bit to fix this
time.Sleep(time.Millisecond)
dst.WritePacket(pkt)
}
}(eof)
Expand Down

0 comments on commit c6b109e

Please sign in to comment.