From fa8567868ecaa869e976f780d799062fb1aee915 Mon Sep 17 00:00:00 2001 From: brandtr Date: Fri, 30 Jun 2017 07:22:15 -0700 Subject: [PATCH] Fix FecTest.FlexfecTest flakiness caused by seq. num. wraparound. The CL in https://codereview.webrtc.org/2918333002/ enabled FecTest.FlexfecTest and also added a sequence number offset between the FEC packets and the media packets. This was to simulate that the sequence numbers were generated from different spaces, i.e., that they belong to different SSRCs. The test does not account for sequence number wraparound, which means that it could fail when the sequence number offset realization was large. This CL fixes the problem by ensuring that the offset always lies in [0, 2^15]. This CL also fixes spelling of UlpfecTest. BUG=webrtc:7912 TESTED=ninja -C out/Debug && third_party/gtest-parallel/gtest-parallel --gtest_filter="*Flexfec*" -r 1000 out/Debug/modules_tests Review-Url: https://codereview.webrtc.org/2966753002 Cr-Commit-Position: refs/heads/master@{#18863} --- webrtc/modules/rtp_rtcp/test/testFec/test_fec.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/webrtc/modules/rtp_rtcp/test/testFec/test_fec.cc b/webrtc/modules/rtp_rtcp/test/testFec/test_fec.cc index a65e8a684f..b23a5f5f9b 100644 --- a/webrtc/modules/rtp_rtcp/test/testFec/test_fec.cc +++ b/webrtc/modules/rtp_rtcp/test/testFec/test_fec.cc @@ -135,7 +135,7 @@ void RunTest(bool use_flexfec) { uint16_t fec_seq_num_offset; if (use_flexfec) { fec_ssrc = random.Rand(1u, 0xfffffffe); - fec_seq_num_offset = random.Rand(); + fec_seq_num_offset = random.Rand(0, 1 << 15); } else { fec_ssrc = media_ssrc; fec_seq_num_offset = 0; @@ -465,13 +465,13 @@ void RunTest(bool use_flexfec) { // Too slow to finish before timeout on iOS. See webrtc:4755. #if defined(WEBRTC_IOS) -#define MAYBE_UlpecTest DISABLED_UlpecTest +#define MAYBE_UlpfecTest DISABLED_UlpfecTest #define MAYBE_FlexfecTest DISABLED_FlexfecTest #else -#define MAYBE_UlpecTest UlpecTest +#define MAYBE_UlpfecTest UlpfecTest #define MAYBE_FlexfecTest FlexfecTest #endif -TEST(FecTest, MAYBE_UlpecTest) { +TEST(FecTest, MAYBE_UlpfecTest) { RunTest(false); }