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

Unified Diff: webrtc/p2p/client/basicportallocator_unittest.cc

Issue 2001093003: Attempting to fix flaky tests that deal with STUN timeout. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 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/p2p/base/stunrequest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/client/basicportallocator_unittest.cc
diff --git a/webrtc/p2p/client/basicportallocator_unittest.cc b/webrtc/p2p/client/basicportallocator_unittest.cc
index 83d904f181480deca88bc1701af4e7e451e6208c..fba7f9932c8b9ccfa2f4e618295323c2b91854a5 100644
--- a/webrtc/p2p/client/basicportallocator_unittest.cc
+++ b/webrtc/p2p/client/basicportallocator_unittest.cc
@@ -75,6 +75,12 @@ static const int kDefaultAllocationTimeout = 1000;
static const char kTurnUsername[] = "test";
static const char kTurnPassword[] = "test";
+// STUN timeout (with all retries) is 9500ms.
+// Add some margin of error for slow bots.
+// TODO(deadbeef): Use simulated clock instead of just increasing timeouts to
+// fix flaky tests.
+static const int kStunTimeoutMs = 15000;
+
namespace cricket {
// Helper for dumping candidates
@@ -1358,8 +1364,8 @@ TEST_F(BasicPortAllocatorTest, TestSharedSocketNoUdpAllowed) {
EXPECT_PRED5(CheckCandidate, candidates_[0],
cricket::ICE_CANDIDATE_COMPONENT_RTP, "local", "udp",
kClientAddr);
- // STUN timeout is 9sec. We need to wait to get candidate done signal.
- EXPECT_TRUE_WAIT(candidate_allocation_done_, 10000);
+ // STUN timeout is 9.5sec. We need to wait to get candidate done signal.
+ EXPECT_TRUE_WAIT(candidate_allocation_done_, kStunTimeoutMs);
EXPECT_EQ(1U, candidates_.size());
}
« no previous file with comments | « webrtc/p2p/base/stunrequest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698