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

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

Issue 2677743002: Increase STUN RTOs (Closed)
Patch Set: merge Created 3 years, 10 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_unittest.cc ('k') | webrtc/pc/webrtcsession_unittest.cc » ('j') | 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 29d29ce1f4d7429b59be2ad9aec8e75f30df2c6d..7bba15b155dc975056e43687b3e251902dfc74c5 100644
--- a/webrtc/p2p/client/basicportallocator_unittest.cc
+++ b/webrtc/p2p/client/basicportallocator_unittest.cc
@@ -84,11 +84,9 @@ static const int kDefaultAllocationTimeout = 3000;
static const char kTurnUsername[] = "test";
static const char kTurnPassword[] = "test";
-// STUN timeout (with all retries) is 9500ms.
+// STUN timeout (with all retries) is cricket::STUN_TOTAL_TIMEOUT.
// 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;
+static const int kStunTimeoutMs = cricket::STUN_TOTAL_TIMEOUT;
namespace cricket {
@@ -1231,10 +1229,11 @@ TEST_F(BasicPortAllocatorTest, TestGetAllPortsNoUdpAllowed) {
EXPECT_PRED4(HasCandidate, candidates_, "relay", "ssltcp",
kRelaySslTcpIntAddr);
EXPECT_PRED4(HasCandidate, candidates_, "relay", "udp", kRelayUdpExtAddr);
- // We wait at least for a full STUN timeout, which is currently 9.5
- // seconds. But since 3-3.5 seconds already passed (see above), we
- // only need 6.5 more seconds.
- EXPECT_TRUE_SIMULATED_WAIT(candidate_allocation_done_, 6500, fake_clock);
+ // We wait at least for a full STUN timeout, which
+ // cricket::STUN_TOTAL_TIMEOUT seconds. But since 3-3.5 seconds
+ // already passed (see above), we wait 3 seconds less than that.
+ EXPECT_TRUE_SIMULATED_WAIT(candidate_allocation_done_,
+ cricket::STUN_TOTAL_TIMEOUT - 3000, fake_clock);
}
TEST_F(BasicPortAllocatorTest, TestCandidatePriorityOfMultipleInterfaces) {
« no previous file with comments | « webrtc/p2p/base/stunrequest_unittest.cc ('k') | webrtc/pc/webrtcsession_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698