diff --git a/pkg/routing/localrouter.go b/pkg/routing/localrouter.go index a30076c5f..fc37c064a 100644 --- a/pkg/routing/localrouter.go +++ b/pkg/routing/localrouter.go @@ -4,9 +4,10 @@ import ( "sync" "time" + "github.com/livekit/protocol/utils" + "github.com/livekit/livekit-server/pkg/logger" livekit "github.com/livekit/livekit-server/proto" - "github.com/livekit/protocol/utils" ) // a router of messages on the same node, basic implementation for local testing @@ -121,7 +122,6 @@ func (r *LocalRouter) Start() error { } func (r *LocalRouter) Stop() { - r.rtcMessageChan.Close() } diff --git a/pkg/routing/redisrouter.go b/pkg/routing/redisrouter.go index f24db9b41..48f7cf136 100644 --- a/pkg/routing/redisrouter.go +++ b/pkg/routing/redisrouter.go @@ -361,7 +361,7 @@ func (r *RedisRouter) handleSignalMessage(sm *livekit.SignalNodeMessage) error { switch rmb := sm.Message.(type) { case *livekit.SignalNodeMessage_Response: - //logger.Debugw("forwarding signal message", + // logger.Debugw("forwarding signal message", // "connectionId", connectionId, // "type", fmt.Sprintf("%T", rmb.Response.Message)) if err := resSink.WriteMessage(rmb.Response); err != nil { @@ -369,7 +369,7 @@ func (r *RedisRouter) handleSignalMessage(sm *livekit.SignalNodeMessage) error { } case *livekit.SignalNodeMessage_EndSession: - //logger.Debugw("received EndSession, closing signal connection", + // logger.Debugw("received EndSession, closing signal connection", // "connectionId", connectionId) resSink.Close() } diff --git a/pkg/rtc/datatrack.go b/pkg/rtc/datatrack.go index bf7ffbfc4..030e73d46 100644 --- a/pkg/rtc/datatrack.go +++ b/pkg/rtc/datatrack.go @@ -32,7 +32,7 @@ type DataTrack struct { func NewDataTrack(trackId, participantId string, dc *webrtc.DataChannel) *DataTrack { t := &DataTrack{ - //ctx: context.Background(), + // ctx: context.Background(), id: trackId, name: dc.Label(), participantId: participantId, @@ -156,8 +156,7 @@ func (t *DataTrack) forwardWorker() { for _, sub := range t.subscribers { err := sub.SendMessage(msg) if err != nil { - logger.Errorw("could not send data message", - err, + logger.Errorw("could not send data message", err, "source", t.participantId, "dest", sub.participantId) } diff --git a/pkg/rtc/participant.go b/pkg/rtc/participant.go index 856ee9390..ad0783cda 100644 --- a/pkg/rtc/participant.go +++ b/pkg/rtc/participant.go @@ -841,7 +841,7 @@ func (p *ParticipantImpl) handleTrackPublished(track types.PublishedTrack) { } func (p *ParticipantImpl) handlePublisherICEStateChange(state webrtc.ICEConnectionState) { - //logger.Debugw("ICE connection state changed", "state", state.String(), + // logger.Debugw("ICE connection state changed", "state", state.String(), // "participant", p.identity) if state == webrtc.ICEConnectionStateConnected { p.updateState(livekit.ParticipantInfo_ACTIVE) @@ -924,9 +924,9 @@ func (p *ParticipantImpl) rtcpSendWorker() { if pkts == nil { return } - //for _, pkt := range pkts { + // for _, pkt := range pkts { // logger.Debugw("writing RTCP", "packet", pkt) - //} + // } if err := p.publisher.pc.WriteRTCP(pkts); err != nil { logger.Errorw("could not write RTCP to participant", err, "participant", p.Identity()) diff --git a/pkg/service/roommanager.go b/pkg/service/roommanager.go index 4700b2a11..9386a78c3 100644 --- a/pkg/service/roommanager.go +++ b/pkg/service/roommanager.go @@ -370,7 +370,7 @@ func (r *RoomManager) rtcSessionWorker(room *rtc.Room, participant types.Partici case *livekit.SignalRequest_Answer: if participant.State() == livekit.ParticipantInfo_JOINING { logger.Errorw("cannot negotiate before peer offer", nil, "participant", participant.Identity()) - //conn.WriteJSON(jsonError(http.StatusNotAcceptable, "cannot negotiate before peer offer")) + // conn.WriteJSON(jsonError(http.StatusNotAcceptable, "cannot negotiate before peer offer")) return } sd := rtc.FromProtoSessionDescription(msg.Answer) @@ -383,7 +383,7 @@ func (r *RoomManager) rtcSessionWorker(room *rtc.Room, participant types.Partici logger.Errorw("could not decode trickle", err, "participant", participant.Identity()) break } - //logger.Debugw("adding peer candidate", "participant", participant.ID()) + // logger.Debugw("adding peer candidate", "participant", participant.ID()) if err := participant.AddICECandidate(candidateInit, msg.Trickle.Target); err != nil { logger.Errorw("could not handle trickle", err, "participant", participant.Identity()) } diff --git a/pkg/service/wire_gen.go b/pkg/service/wire_gen.go index c7bddcffb..62d017ed7 100644 --- a/pkg/service/wire_gen.go +++ b/pkg/service/wire_gen.go @@ -1,6 +1,6 @@ // Code generated by Wire. DO NOT EDIT. -//go:generate wire +//go:generate go run github.com/google/wire/cmd/wire //+build !wireinject package service diff --git a/test/integration_helpers.go b/test/integration_helpers.go index 1d885d5c8..a8a2e38f7 100644 --- a/test/integration_helpers.go +++ b/test/integration_helpers.go @@ -9,17 +9,17 @@ import ( "time" "github.com/go-redis/redis/v8" - "github.com/livekit/livekit-server/pkg/testutils" - testclient "github.com/livekit/livekit-server/test/client" + "github.com/livekit/protocol/auth" + "github.com/livekit/protocol/utils" "github.com/twitchtv/twirp" "github.com/livekit/livekit-server/pkg/config" "github.com/livekit/livekit-server/pkg/logger" "github.com/livekit/livekit-server/pkg/routing" "github.com/livekit/livekit-server/pkg/service" + "github.com/livekit/livekit-server/pkg/testutils" livekit "github.com/livekit/livekit-server/proto" - "github.com/livekit/protocol/auth" - "github.com/livekit/protocol/utils" + testclient "github.com/livekit/livekit-server/test/client" ) const ( @@ -34,7 +34,7 @@ const ( syncDelay = 100 * time.Millisecond // if there are deadlocks, it's helpful to set a short test timeout (i.e. go test -timeout=30s) // let connection timeout happen - //connectTimeout = 5000 * time.Second + // connectTimeout = 5000 * time.Second ) var ( @@ -112,7 +112,6 @@ func waitForServerToStart(s *service.LivekitServer) { func waitUntilConnected(t *testing.T, clients ...*testclient.RTCClient) { logger.Infow("waiting for clients to become connected") wg := sync.WaitGroup{} - errChan := make(chan error, len(clients)) for i := range clients { c := clients[i] wg.Add(1) @@ -120,15 +119,13 @@ func waitUntilConnected(t *testing.T, clients ...*testclient.RTCClient) { defer wg.Done() err := c.WaitUntilConnected() if err != nil { - errChan <- err t.Error(err) } }() } wg.Wait() - close(errChan) - for err := range errChan { - t.Fatal(err) + if t.Failed() { + t.FailNow() } }