diff --git a/test/lktest/livekit.go b/test/lktest/livekit.go index 81155e3..47d00d3 100644 --- a/test/lktest/livekit.go +++ b/test/lktest/livekit.go @@ -64,10 +64,8 @@ type LiveKit struct { WsUrl string } -func (lk *LiveKit) ListRooms(t TB, names []string) []*livekit.Room { - resp, err := lk.Rooms.ListRooms(context.Background(), &livekit.ListRoomsRequest{ - Names: names, - }) +func (lk *LiveKit) ListRooms(t TB) []*livekit.Room { + resp, err := lk.Rooms.ListRooms(context.Background(), &livekit.ListRoomsRequest{}) if err != nil { t.Fatal(err) } @@ -433,12 +431,12 @@ wait: } } -func (lk *LiveKit) waitRooms(t TB, ctx context.Context, none bool, filter func(r *livekit.Room) bool, names []string) []*livekit.Room { +func (lk *LiveKit) waitRooms(t TB, ctx context.Context, none bool, filter func(r *livekit.Room) bool) []*livekit.Room { var rooms []*livekit.Room ticker := time.NewTicker(time.Second / 4) defer ticker.Stop() for { - rooms = lk.ListRooms(t, names) + rooms = lk.ListRooms(t) if filter != nil { var out []*livekit.Room for _, r := range rooms { @@ -469,7 +467,7 @@ func (lk *LiveKit) ExpectRoomWithParticipants(t TB, ctx context.Context, room st filter := func(r *livekit.Room) bool { return r.Name == room } - rooms := lk.waitRooms(t, ctx, len(participants) == 0, filter, []string{room}) + rooms := lk.waitRooms(t, ctx, len(participants) == 0, filter) if len(participants) == 0 && len(rooms) == 0 { return } @@ -483,7 +481,7 @@ func (lk *LiveKit) ExpectRoomPref(t TB, ctx context.Context, pref, number string filter := func(r *livekit.Room) bool { return r.Name != pref && strings.HasPrefix(r.Name, pref+"_"+number+"_") } - rooms := lk.waitRooms(t, ctx, none, filter, nil) + rooms := lk.waitRooms(t, ctx, none, filter) require.Len(t, rooms, 1) require.True(t, filter(rooms[0])) t.Log("Room:", rooms[0].Name)