From 7804c54b973e735de0dd7febe7251f2c66536f2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Bostr=C3=B6m?= Date: Wed, 10 Jun 2020 10:12:13 +0200 Subject: [PATCH] [Stats flake] Mark outbound-rtp.framesPerSecond as optional. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It has been reported that sometimes FPS is undefined, causing the test to be flaky. Bug: webrtc:11651 Change-Id: Ieea33833724defa46110aad5d103aa16bfbea861 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176516 Commit-Queue: Henrik Boström Reviewed-by: Harald Alvestrand Cr-Commit-Position: refs/heads/master@{#31481} --- pc/rtc_stats_integrationtest.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pc/rtc_stats_integrationtest.cc b/pc/rtc_stats_integrationtest.cc index b757c4e137..f6b6922a76 100644 --- a/pc/rtc_stats_integrationtest.cc +++ b/pc/rtc_stats_integrationtest.cc @@ -913,8 +913,17 @@ class RTCStatsReportVerifier { verifier.MarkMemberTested(outbound_stream.content_type, true); verifier.TestMemberIsDefined(outbound_stream.encoder_implementation); if (enable_simulcast_stats) { - verifier.TestMemberIsNonNegative( - outbound_stream.frames_per_second); + // Unless an implementation-specific amount of time has passed and at + // least one frame has been encoded, undefined is reported. Because it + // is hard to tell what is the case here, we treat FPS as optional. + // TODO(hbos): Update the tests to run until all implemented metrics + // should be populated. + if (outbound_stream.frames_per_second.is_defined()) { + verifier.TestMemberIsNonNegative( + outbound_stream.frames_per_second); + } else { + verifier.TestMemberIsUndefined(outbound_stream.frames_per_second); + } verifier.TestMemberIsNonNegative( outbound_stream.frame_height); verifier.TestMemberIsNonNegative(outbound_stream.frame_width);