Skip to content

Commit

Permalink
fix race condition in WebRTC tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 committed Apr 7, 2024
1 parent d5a18bf commit 12d9be2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/servers/webrtc/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,17 @@ func TestServerPublish(t *testing.T) {
path.stream.Desc().Medias[0],
path.stream.Desc().Medias[0].Formats[0],
func(u unit.Unit) error {
select {
case <-recv:
return nil
default:
}

require.Equal(t, [][]byte{
{1},
}, u.(*unit.H264).AU)
close(recv)

return nil
})

Expand Down

0 comments on commit 12d9be2

Please sign in to comment.