From 12fb17035c8dcad9c4f37a038053218f4837e163 Mon Sep 17 00:00:00 2001 From: Sebastian Jansson Date: Fri, 23 Feb 2018 11:34:18 +0100 Subject: [PATCH] Added some margin to ramp down target in perf test. The bit rate target for ramp down in was set equal to the simulated capacity. Expected behavior of an estimator is to achieve an estimate near the true value but not always the exact value. Adding a margin allows from noise in the measurement while still testing for the desired behavor. Bug: webrtc:8878 Change-Id: I18fb6c9704bf08e58ee08ce6c85abee2eaa08356 Reviewed-on: https://webrtc-review.googlesource.com/57080 Reviewed-by: Niels Moller Reviewed-by: Stefan Holmer Commit-Queue: Sebastian Jansson Cr-Commit-Position: refs/heads/master@{#22171} --- call/rampup_tests.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/call/rampup_tests.cc b/call/rampup_tests.cc index 6b20ecdb30..a93dd7957c 100644 --- a/call/rampup_tests.cc +++ b/call/rampup_tests.cc @@ -24,7 +24,9 @@ static const int64_t kPollIntervalMs = 20; static const int kExpectedHighVideoBitrateBps = 80000; static const int kExpectedHighAudioBitrateBps = 30000; static const int kLowBandwidthLimitBps = 20000; -static const int kExpectedLowBitrateBps = 20000; +// Set target detected bitrate to slightly larger than the target bitrate to +// avoid flakiness. +static const int kLowBitrateMarginBps = 2000; std::vector GenerateSsrcs(size_t num_streams, uint32_t ssrc_offset) { std::vector ssrcs; @@ -510,7 +512,7 @@ void RampUpDownUpTester::EvolveTestState(int bitrate_bps, bool suspended) { case kLowRate: { // Audio streams are never suspended. bool check_suspend_state = num_video_streams_ > 0; - if (bitrate_bps < kExpectedLowBitrateBps && + if (bitrate_bps < kLowBandwidthLimitBps + kLowBitrateMarginBps && suspended == check_suspend_state) { if (report_perf_stats_) { webrtc::test::PrintResult("ramp_up_down_up", GetModifierString(),