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 <nisse@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22171}
diff --git a/call/rampup_tests.cc b/call/rampup_tests.cc
index 6b20ecd..a93dd79 100644
--- a/call/rampup_tests.cc
+++ b/call/rampup_tests.cc
@@ -24,7 +24,9 @@
 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<uint32_t> GenerateSsrcs(size_t num_streams, uint32_t ssrc_offset) {
   std::vector<uint32_t> ssrcs;
@@ -510,7 +512,7 @@
     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(),