Try to deflake VideoSendStream tests with ULPFEC.
The changes here are the same as in https://codereview.webrtc.org/2523993002/:
- reduce packet loss from 50% to 5%, to allow the BWE to ramp up better.
- Do not wait for 100 packets to be sent before letting the test pass.
BUG=webrtc:6851
Review-Url: https://codereview.webrtc.org/2558303002
Cr-Commit-Position: refs/heads/master@{#15542}
diff --git a/webrtc/video/video_send_stream_tests.cc b/webrtc/video/video_send_stream_tests.cc
index 82fb6be..7a11ae1 100644
--- a/webrtc/video/video_send_stream_tests.cc
+++ b/webrtc/video/video_send_stream_tests.cc
@@ -353,18 +353,17 @@
class UlpfecObserver : public test::EndToEndTest {
public:
UlpfecObserver(bool header_extensions_enabled,
- bool use_nack,
- bool expect_red,
- bool expect_ulpfec,
- const std::string& codec)
+ bool use_nack,
+ bool expect_red,
+ bool expect_ulpfec,
+ const std::string& codec)
: EndToEndTest(VideoSendStreamTest::kDefaultTimeoutMs),
payload_name_(codec),
use_nack_(use_nack),
expect_red_(expect_red),
expect_ulpfec_(expect_ulpfec),
- send_count_(0),
- received_media_(false),
- received_fec_(false),
+ sent_media_(false),
+ sent_ulpfec_(false),
header_extensions_enabled_(header_extensions_enabled) {
if (codec == "H264") {
encoder_.reset(new test::FakeH264Encoder(Clock::GetRealTimeClock()));
@@ -382,7 +381,6 @@
RTPHeader header;
EXPECT_TRUE(parser_->Parse(packet, length, &header));
- ++send_count_;
int encapsulated_payload_type = -1;
if (header.payloadType == VideoSendStreamTest::kRedPayloadType) {
EXPECT_TRUE(expect_red_);
@@ -399,7 +397,7 @@
length) {
// Not padding-only, media received outside of RED.
EXPECT_FALSE(expect_red_);
- received_media_ = true;
+ sent_media_ = true;
}
}
@@ -425,14 +423,14 @@
if (encapsulated_payload_type ==
VideoSendStreamTest::kUlpfecPayloadType) {
EXPECT_TRUE(expect_ulpfec_);
- received_fec_ = true;
+ sent_ulpfec_ = true;
} else {
- received_media_ = true;
+ sent_media_ = true;
}
}
- if (send_count_ > 100 && received_media_) {
- if (received_fec_ || !expect_ulpfec_)
+ if (sent_media_) {
+ if (sent_ulpfec_ || !expect_ulpfec_)
observation_complete_.Set();
}
@@ -446,7 +444,7 @@
// Configure some network delay.
const int kNetworkDelayMs = 100;
FakeNetworkPipe::Config config;
- config.loss_percent = 50;
+ config.loss_percent = 5;
config.queue_delay_ms = kNetworkDelayMs;
return new test::PacketTransport(sender_call, this,
test::PacketTransport::kSender, config);
@@ -484,7 +482,7 @@
}
void PerformTest() override {
- EXPECT_TRUE(Wait()) << "Timed out waiting for FEC and media packets.";
+ EXPECT_TRUE(Wait()) << "Timed out waiting for ULPFEC and/or media packets.";
}
std::unique_ptr<internal::TransportAdapter> transport_adapter_;
@@ -493,9 +491,8 @@
const bool use_nack_;
const bool expect_red_;
const bool expect_ulpfec_;
- int send_count_;
- bool received_media_;
- bool received_fec_;
+ bool sent_media_;
+ bool sent_ulpfec_;
bool header_extensions_enabled_;
RTPHeader prev_header_;
};