Fix threading in EndToEndTestWithTls.NoUndecryptablePackets
TSAN detected a threading issue in this test where the server stats are accessed from the main thread while the server thread is still running (and can write to them while we're reading). This CL matches the convention in the rest of the file which is to pause the server thread before accessing the server stats and resume it afterward.
gfe-relnote: n/a, test-only change
PiperOrigin-RevId: 250244377
Change-Id: I167416683b9030df275ef73062974f64819fbb0d
diff --git a/quic/core/http/end_to_end_test.cc b/quic/core/http/end_to_end_test.cc
index 36ab085..c751cf8 100644
--- a/quic/core/http/end_to_end_test.cc
+++ b/quic/core/http/end_to_end_test.cc
@@ -739,10 +739,12 @@
QuicConnectionStats client_stats =
client_->client()->client_session()->connection()->GetStats();
- QuicConnectionStats server_stats = GetServerConnection()->GetStats();
-
EXPECT_EQ(0u, client_stats.undecryptable_packets_received);
+
+ server_thread_->Pause();
+ QuicConnectionStats server_stats = GetServerConnection()->GetStats();
EXPECT_EQ(0u, server_stats.undecryptable_packets_received);
+ server_thread_->Resume();
}
TEST_P(EndToEndTestWithTls, SeparateFinPacket) {