Skip to content

Commit c588014

Browse files
committed
Modified to wait for remote_track to reach the predetermined highest layer before testing.
1 parent d9d93b8 commit c588014

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

livekit-rtc/tests/test_change_video_quality.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,15 @@ async def test_simulcast_quality_layers(
333333

334334
stream = rtc.VideoStream.from_track(track=remote_pub.track)
335335

336+
# Bandwidth can be unstable right after subscribe — explicitly request
337+
# the top layer and wait until we see HIGH-resolution frames before
338+
# starting the quality-switching assertions. Use a longer timeout
339+
# here since the encoder may need extra time to ramp up to f.
340+
remote_pub.set_video_quality(VideoQuality.VIDEO_QUALITY_HIGH)
341+
ew, eh = LAYER_DIMENSIONS["f"]
342+
warmup = await _wait_for_layer(stream, ew, eh, timeout=40.0)
343+
print(f"[{codec_name}] warmup HIGH/f got={warmup[0]}x{warmup[1]}")
344+
336345
for quality, layer in QUALITY_SEQUENCE:
337346
remote_pub.set_video_quality(quality)
338347
ew, eh = LAYER_DIMENSIONS[layer]

0 commit comments

Comments
 (0)