Test improvements (#136)
* Fix "ineffectual assignment" linter warning * Simplify TestClientCouldConnect * Simplify range expression
This commit is contained in:
+1
-1
@@ -154,7 +154,7 @@ func scenarioWSReconnect(t *testing.T) {
|
|||||||
func publishTracksForClients(t *testing.T, clients ...*testclient.RTCClient) []*testclient.TrackWriter {
|
func publishTracksForClients(t *testing.T, clients ...*testclient.RTCClient) []*testclient.TrackWriter {
|
||||||
logger.Infow("publishing tracks for clients")
|
logger.Infow("publishing tracks for clients")
|
||||||
var writers []*testclient.TrackWriter
|
var writers []*testclient.TrackWriter
|
||||||
for i, _ := range clients {
|
for i := range clients {
|
||||||
c := clients[i]
|
c := clients[i]
|
||||||
tw, err := c.AddStaticTrack("audio/opus", "audio", "webcam")
|
tw, err := c.AddStaticTrack("audio/opus", "audio", "webcam")
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|||||||
@@ -28,11 +28,7 @@ func TestClientCouldConnect(t *testing.T) {
|
|||||||
|
|
||||||
// ensure they both see each other
|
// ensure they both see each other
|
||||||
testutils.WithTimeout(t, "c1 and c2 could connect", func() bool {
|
testutils.WithTimeout(t, "c1 and c2 could connect", func() bool {
|
||||||
if len(c1.RemoteParticipants()) == 0 || len(c2.RemoteParticipants()) == 0 {
|
return len(c1.RemoteParticipants()) != 0 && len(c2.RemoteParticipants()) != 0
|
||||||
return false
|
|
||||||
}
|
|
||||||
//require.Equal()
|
|
||||||
return true
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,7 +99,7 @@ func TestSinglePublisher(t *testing.T) {
|
|||||||
// when c3 disconnects.. ensure subscriber is cleaned up correctly
|
// when c3 disconnects.. ensure subscriber is cleaned up correctly
|
||||||
c3.Stop()
|
c3.Stop()
|
||||||
|
|
||||||
success = testutils.WithTimeout(t, "c3 is cleaned up as a subscriber", func() bool {
|
testutils.WithTimeout(t, "c3 is cleaned up as a subscriber", func() bool {
|
||||||
room := s.RoomManager().GetRoom(context.Background(), testRoom)
|
room := s.RoomManager().GetRoom(context.Background(), testRoom)
|
||||||
require.NotNil(t, room)
|
require.NotNil(t, room)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user