Fix flaky EndToEndTestWithTls.NoUndecryptablePackets
This test was failing on rare occasions because due to reordering the server would end up receiving a retransmission of the CHLO after it completed the handshake and discarded initial keys. Since QuicConnectionStats::undecryptable_packets_received had been added solely for the purpose of this test and isn't used elsewhere, we replaced it with undecryptable_packets_received_before_handshake_complete which is what we want for this test. Instead of testing for the absence of undecryptable packets at all, we now only test for them before the handshake. This still covers the regression that this test was created for.
gfe-relnote: change statistic that is only used by tests
PiperOrigin-RevId: 269444711
Change-Id: Ie846162b6bf7b65c8c3f7196b9cd58e29d45d892
diff --git a/quic/core/quic_connection_stats.cc b/quic/core/quic_connection_stats.cc
index 98859ac..c08f939 100644
--- a/quic/core/quic_connection_stats.cc
+++ b/quic/core/quic_connection_stats.cc
@@ -29,7 +29,7 @@
slowstart_duration(QuicTime::Delta::Zero()),
slowstart_start_time(QuicTime::Zero()),
packets_dropped(0),
- undecryptable_packets_received(0),
+ undecryptable_packets_received_before_handshake_complete(0),
crypto_retransmit_count(0),
loss_timeout_count(0),
tlp_count(0),
@@ -73,7 +73,8 @@
os << " slowstart_packets_lost: " << s.slowstart_packets_lost;
os << " slowstart_bytes_lost: " << s.slowstart_bytes_lost;
os << " packets_dropped: " << s.packets_dropped;
- os << " undecryptable_packets_received: " << s.undecryptable_packets_received;
+ os << " undecryptable_packets_received_before_handshake_complete: "
+ << s.undecryptable_packets_received_before_handshake_complete;
os << " crypto_retransmit_count: " << s.crypto_retransmit_count;
os << " loss_timeout_count: " << s.loss_timeout_count;
os << " tlp_count: " << s.tlp_count;