test: give mock participants a connection quality, close test rooms (#4933)
Test / test (push) Canceled after 0s
Release to Docker / docker (push) Canceled after 0s
Release Test Server to Docker / docker (push) Canceled after 0s

* test: give mock participants a connection quality

A real participant never returns a nil connection quality. The mock
did, which can crash code that does not expect nil.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: close test rooms when each test ends

Most room tests left their rooms open, so each room's workers kept
running for the rest of the package.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Raja Subramanian
2026-10-04 23:54:14 +05:30
committed by GitHub
co-authored by Claude Opus 5.5
parent c2339b2b85
commit 44b791ad50
2 changed files with 7 additions and 0 deletions
+6
View File
@@ -23,6 +23,7 @@ import (
"github.com/livekit/livekit-server/pkg/rtc/types"
"github.com/livekit/livekit-server/pkg/rtc/types/typesfakes"
"github.com/livekit/livekit-server/pkg/sfu/connectionquality"
)
func NewMockParticipant(
@@ -54,6 +55,11 @@ func NewMockParticipant(
State: livekit.ParticipantInfo_JOINED,
IsPublisher: publisher,
}, utils.TimedVersion(0))
p.GetConnectionQualityReturns(&livekit.ConnectionQualityInfo{
ParticipantSid: sid,
Quality: livekit.ConnectionQuality_EXCELLENT,
Score: connectionquality.MaxMOS,
})
p.SetMetadataCalls(func(m string) {
participantListener.OnParticipantUpdate(p)