Enabling IPv6 socket recv timestamp test, and making less flaky.

The test worked by sleeping a certain time, then checking that the
difference between recv timestamps before and after the sleep was
within some margin of the requested sleep time.

However, this means that imprecision of SleepMs makes the test flaky.
This source of flakiness can be removed by comparing to the actual
time slept instead of the requested time.

Also making the margin larger, to further reduce the likelihood of
flakiness.

R=pthatcher@webrtc.org, stefan@webrtc.org

Review URL: https://codereview.webrtc.org/2111043004 .

Cr-Commit-Position: refs/heads/master@{#13733}
This commit is contained in:
Taylor Brandstetter
2016-08-11 15:38:28 -07:00
parent 588783adcd
commit 6f82535f45
4 changed files with 27 additions and 17 deletions

View File

@ -57,7 +57,8 @@ class SocketTest : public testing::Test {
void TestUdpReadyToSendIPv6();
void TestGetSetOptionsIPv4();
void TestGetSetOptionsIPv6();
void TestSocketRecvTimestamp();
void TestSocketRecvTimestampIPv4();
void TestSocketRecvTimestampIPv6();
static const int kTimeout = 5000; // ms
const IPAddress kIPv4Loopback;