Index: webrtc/p2p/base/stunrequest_unittest.cc |
diff --git a/webrtc/p2p/base/stunrequest_unittest.cc b/webrtc/p2p/base/stunrequest_unittest.cc |
index 5845a0ecbbbca52ea6d1336a6758b081305a76ed..5fb34a85d263e1ec90e74dd59711e3cb9d97557a 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 @@ TEST_F(StunRequestTest, TestTimeout) { |
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); |