Increasing STUN timeout for some more tests.
A 500ms margin of error from STUN timeout to test timeout is not
enough for some buildbots.
TBR=pthatcher@webrtc.org
NOTRY=True
Review-Url: https://codereview.webrtc.org/2015763004
Cr-Commit-Position: refs/heads/master@{#12932}
diff --git a/webrtc/p2p/base/relayport_unittest.cc b/webrtc/p2p/base/relayport_unittest.cc
index 738ea9a..8574af3 100644
--- a/webrtc/p2p/base/relayport_unittest.cc
+++ b/webrtc/p2p/base/relayport_unittest.cc
@@ -152,8 +152,11 @@
EXPECT_FALSE(relay_port_->IsReady());
- // Should have timed out in 200 + 200 + 400 + 800 + 1600 ms.
- EXPECT_TRUE_WAIT(HasFailed(&fake_protocol_address), 3600);
+ // Should have timed out in 200 + 200 + 400 + 800 + 1600 ms = 3200ms.
+ // Add some margin of error for slow bots.
+ // TODO(deadbeef): Use simulated clock instead of just increasing timeouts
+ // to fix flaky tests.
+ EXPECT_TRUE_WAIT(HasFailed(&fake_protocol_address), 5000);
// Wait until relayport is ready.
EXPECT_TRUE_WAIT(relay_port_->IsReady(), kMaxTimeoutMs);
diff --git a/webrtc/p2p/base/stunrequest_unittest.cc b/webrtc/p2p/base/stunrequest_unittest.cc
index 5845a0e..5fb34a8 100644
--- a/webrtc/p2p/base/stunrequest_unittest.cc
+++ b/webrtc/p2p/base/stunrequest_unittest.cc
@@ -17,6 +17,12 @@
using namespace cricket;
+// 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 kTimeoutMs = 15000;
+
class StunRequestTest : public testing::Test,
public sigslot::has_slots<> {
public:
@@ -172,7 +178,7 @@
StunMessage* res = CreateStunMessage(STUN_BINDING_RESPONSE, req);
manager_.Send(new StunRequestThunker(req, this));
- rtc::Thread::Current()->ProcessMessages(10000); // > STUN timeout
+ rtc::Thread::Current()->ProcessMessages(kTimeoutMs);
EXPECT_FALSE(manager_.CheckResponse(res));
EXPECT_TRUE(response_ == NULL);