Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(688)

Unified Diff: net/quic/quic_sent_packet_manager_test.cc

Issue 352403002: Repair the CWND reduction caused by spurious RTO's in QUIC's congestion (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_sent_packet_manager.cc ('k') | net/quic/quic_unacked_packet_map.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_sent_packet_manager_test.cc
diff --git a/net/quic/quic_sent_packet_manager_test.cc b/net/quic/quic_sent_packet_manager_test.cc
index 4e94b382de4a8ebad66ce19453744b2cb3df9e42..65f086e24e15f6fae053f6b0ff73f6f48abcb261 100644
--- a/net/quic/quic_sent_packet_manager_test.cc
+++ b/net/quic/quic_sent_packet_manager_test.cc
@@ -423,6 +423,7 @@ TEST_F(QuicSentPacketManagerTest, RetransmitTwiceThenAckPreviousBeforeSend) {
ReceivedPacketInfo received_info;
received_info.largest_observed = 1;
ExpectUpdatedRtt(1);
+ EXPECT_CALL(*send_algorithm_, RevertRetransmissionTimeout());
manager_.OnIncomingAck(received_info, clock_.ApproximateNow());
// Since 2 was marked for retransmit, when 1 is acked, 2 is kept for RTT.
@@ -1203,6 +1204,8 @@ TEST_F(QuicSentPacketManagerTest, GetTransmissionTimeRTO) {
SendDataPacket(1);
SendDataPacket(2);
+ SendDataPacket(3);
+ SendDataPacket(4);
QuicTime::Delta expected_rto_delay = QuicTime::Delta::FromMilliseconds(500);
EXPECT_CALL(*send_algorithm_, RetransmissionDelay())
@@ -1214,9 +1217,12 @@ TEST_F(QuicSentPacketManagerTest, GetTransmissionTimeRTO) {
EXPECT_CALL(*send_algorithm_, OnRetransmissionTimeout(true));
clock_.AdvanceTime(expected_rto_delay);
manager_.OnRetransmissionTimeout();
- RetransmitNextPacket(3);
- RetransmitNextPacket(4);
- EXPECT_FALSE(manager_.HasPendingRetransmissions());
+ EXPECT_EQ(0u, QuicSentPacketManagerPeer::GetBytesInFlight(&manager_));
+ RetransmitNextPacket(5);
+ RetransmitNextPacket(6);
+ EXPECT_EQ(2 * kDefaultLength,
+ QuicSentPacketManagerPeer::GetBytesInFlight(&manager_));
+ EXPECT_TRUE(manager_.HasPendingRetransmissions());
// The delay should double the second time.
expected_time = clock_.Now().Add(expected_rto_delay).Add(expected_rto_delay);
@@ -1227,9 +1233,15 @@ TEST_F(QuicSentPacketManagerTest, GetTransmissionTimeRTO) {
received_info.largest_observed = 2;
received_info.missing_packets.insert(1);
ExpectUpdatedRtt(2);
+ EXPECT_CALL(*send_algorithm_, RevertRetransmissionTimeout());
manager_.OnIncomingAck(received_info, clock_.ApproximateNow());
+ EXPECT_FALSE(manager_.HasPendingRetransmissions());
+ EXPECT_EQ(4 * kDefaultLength,
+ QuicSentPacketManagerPeer::GetBytesInFlight(&manager_));
- expected_time = clock_.Now().Add(expected_rto_delay);
+ // Wait 2RTTs from now for the RTO, since it's the max of the RTO time
+ // and the TLP time. In production, there would always be two TLP's first.
+ expected_time = clock_.Now().Add(QuicTime::Delta::FromMilliseconds(200));
EXPECT_EQ(expected_time, manager_.GetRetransmissionTime());
}
« no previous file with comments | « net/quic/quic_sent_packet_manager.cc ('k') | net/quic/quic_unacked_packet_map.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698