Attempting to fix flaky tests that deal with STUN timeout.
The STUN timeout is 9500ms, and the tests are waiting for 10000ms. The 500ms margin of error is not enough for some bots (such as UBSan). R=pthatcher@webrtc.org Review URL: https://codereview.webrtc.org/2001093003 . Cr-Commit-Position: refs/heads/master@{#12854}
This commit is contained in:
parent
1e43562836
commit
8fcf414846
@ -30,7 +30,11 @@ static const SocketAddress kStunAddr3("127.0.0.1", 3000);
|
||||
static const SocketAddress kBadAddr("0.0.0.1", 5000);
|
||||
static const SocketAddress kStunHostnameAddr("localhost", 5000);
|
||||
static const SocketAddress kBadHostnameAddr("not-a-real-hostname", 5000);
|
||||
static const int kTimeoutMs = 10000;
|
||||
// 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;
|
||||
// stun prio = 100 << 24 | 30 (IPV4) << 8 | 256 - 0
|
||||
static const uint32_t kStunCandidatePriority = 1677729535;
|
||||
static const int kInfiniteLifetime = -1;
|
||||
|
||||
@ -221,6 +221,8 @@ void StunRequest::OnMessage(rtc::Message* pmsg) {
|
||||
|
||||
OnSent();
|
||||
manager_->thread_->PostDelayed(resend_delay(), this, MSG_STUN_SEND, NULL);
|
||||
LOG(LS_INFO) << "Sent STUN request " << count_
|
||||
<< "; resend delay = " << resend_delay();
|
||||
}
|
||||
|
||||
void StunRequest::OnSent() {
|
||||
|
||||
@ -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());
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user