Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Unified Diff: webrtc/video/end_to_end_tests.cc

Issue 2777913002: Reduce flakiness in EndToEnd probing tests. (Closed)
Patch Set: Retry InitalProbing as well. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/test/call_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/end_to_end_tests.cc
diff --git a/webrtc/video/end_to_end_tests.cc b/webrtc/video/end_to_end_tests.cc
index 6f030c3b58ff6cc136f6b3ed10c9398a73ac155d..174dc5fd2db8591c82ba7a7c0026d07ec35dfe8e 100644
--- a/webrtc/video/end_to_end_tests.cc
+++ b/webrtc/video/end_to_end_tests.cc
@@ -2236,43 +2236,54 @@ class ProbingTest : public test::EndToEndTest {
TEST_F(EndToEndTest, MAYBE_InitialProbing) {
class InitialProbingTest : public ProbingTest {
public:
- InitialProbingTest() : ProbingTest(300000) {}
+ explicit InitialProbingTest(bool* success)
+ : ProbingTest(300000), success_(success) {}
void PerformTest() override {
int64_t start_time_ms = clock_->TimeInMilliseconds();
do {
- if (clock_->TimeInMilliseconds() - start_time_ms > kTimeoutMs) {
- ADD_FAILURE() << "Timed out while waiting for initial probing.";
+ if (clock_->TimeInMilliseconds() - start_time_ms > kTimeoutMs)
break;
- }
Call::Stats stats = sender_call_->GetStats();
// Initial probing is done with a x3 and x6 multiplier of the start
// bitrate, so a x4 multiplier is a high enough threshold.
- if (stats.send_bandwidth_bps > 4 * 300000)
+ if (stats.send_bandwidth_bps > 4 * 300000) {
+ *success_ = true;
break;
+ }
} while (!observation_complete_.Wait(20));
}
private:
const int kTimeoutMs = 1000;
- } test;
+ bool* const success_;
+ };
- RunBaseTest(&test);
+ bool success;
+ const int kMaxAttempts = 3;
+ for (int i = 0; i < kMaxAttempts; ++i) {
+ InitialProbingTest test(&success);
+ RunBaseTest(&test);
+ if (success)
+ return;
+ }
+ RTC_DCHECK(success) << "Failed to perform mid initial probing ("
+ << kMaxAttempts << " attempts).";
}
TEST_F(EndToEndTest, TriggerMidCallProbing) {
class TriggerMidCallProbingTest : public ProbingTest {
public:
- TriggerMidCallProbingTest() : ProbingTest(300000) {}
+ explicit TriggerMidCallProbingTest(bool* success)
+ : ProbingTest(300000), success_(success) {}
void PerformTest() override {
+ *success_ = false;
int64_t start_time_ms = clock_->TimeInMilliseconds();
do {
- if (clock_->TimeInMilliseconds() - start_time_ms > kTimeoutMs) {
- ADD_FAILURE() << "Timed out while waiting for mid-call probing.";
+ if (clock_->TimeInMilliseconds() - start_time_ms > kTimeoutMs)
break;
- }
Call::Stats stats = sender_call_->GetStats();
@@ -2297,8 +2308,10 @@ TEST_F(EndToEndTest, TriggerMidCallProbing) {
// During high cpu load the pacer will not be able to pace packets
// at the correct speed, but if we go from 110 to 1250 kbps
// in 5 seconds then it is due to probing.
- if (stats.send_bandwidth_bps > 1250000)
+ if (stats.send_bandwidth_bps > 1250000) {
+ *success_ = true;
observation_complete_.Set();
+ }
break;
}
} while (!observation_complete_.Wait(20));
@@ -2306,9 +2319,19 @@ TEST_F(EndToEndTest, TriggerMidCallProbing) {
private:
const int kTimeoutMs = 5000;
- } test;
+ bool* const success_;
+ };
- RunBaseTest(&test);
+ bool success;
+ const int kMaxAttempts = 3;
+ for (int i = 0; i < kMaxAttempts; ++i) {
+ TriggerMidCallProbingTest test(&success);
+ RunBaseTest(&test);
+ if (success)
+ return;
+ }
+ RTC_DCHECK(success) << "Failed to perform mid call probing (" << kMaxAttempts
+ << " attempts).";
}
TEST_F(EndToEndTest, VerifyNackStats) {
« no previous file with comments | « webrtc/test/call_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698