mirror of
https://github.com/livekit/livekit.git
synced 2026-03-30 13:25:42 +00:00
Test improvements (#136)
* Fix "ineffectual assignment" linter warning * Simplify TestClientCouldConnect * Simplify range expression
This commit is contained in:
@@ -154,7 +154,7 @@ func scenarioWSReconnect(t *testing.T) {
|
||||
func publishTracksForClients(t *testing.T, clients ...*testclient.RTCClient) []*testclient.TrackWriter {
|
||||
logger.Infow("publishing tracks for clients")
|
||||
var writers []*testclient.TrackWriter
|
||||
for i, _ := range clients {
|
||||
for i := range clients {
|
||||
c := clients[i]
|
||||
tw, err := c.AddStaticTrack("audio/opus", "audio", "webcam")
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -28,11 +28,7 @@ func TestClientCouldConnect(t *testing.T) {
|
||||
|
||||
// ensure they both see each other
|
||||
testutils.WithTimeout(t, "c1 and c2 could connect", func() bool {
|
||||
if len(c1.RemoteParticipants()) == 0 || len(c2.RemoteParticipants()) == 0 {
|
||||
return false
|
||||
}
|
||||
//require.Equal()
|
||||
return true
|
||||
return len(c1.RemoteParticipants()) != 0 && len(c2.RemoteParticipants()) != 0
|
||||
})
|
||||
}
|
||||
|
||||
@@ -103,7 +99,7 @@ func TestSinglePublisher(t *testing.T) {
|
||||
// when c3 disconnects.. ensure subscriber is cleaned up correctly
|
||||
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)
|
||||
require.NotNil(t, room)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user