- Remove all experiments that tunes blackhole detection delay or path degrading delay, and
- Ensure network blackhole delay is at least path degrading delay plus 2 PTOs.

This is to avoid issues like https://bugs.chromium.org/p/chromium/issues/detail?id=1334029.

Protected by FLAGS_quic_reloadable_flag_quic_remove_blackhole_detection_experiments.

PiperOrigin-RevId: 454883575
diff --git a/quiche/quic/core/quic_connection_test.cc b/quiche/quic/core/quic_connection_test.cc
index b3c01d5..2a89850 100644
--- a/quiche/quic/core/quic_connection_test.cc
+++ b/quiche/quic/core/quic_connection_test.cc
@@ -10643,7 +10643,8 @@
 }
 
 TEST_P(QuicConnectionTest, 2RtoBlackholeDetection) {
-  if (!GetQuicReloadableFlag(quic_default_enable_5rto_blackhole_detection2)) {
+  if (!GetQuicReloadableFlag(quic_default_enable_5rto_blackhole_detection2) ||
+      GetQuicReloadableFlag(quic_remove_blackhole_detection_experiments)) {
     return;
   }
   QuicConfig config;
@@ -10670,7 +10671,8 @@
 }
 
 TEST_P(QuicConnectionTest, 3RtoBlackholeDetection) {
-  if (!GetQuicReloadableFlag(quic_default_enable_5rto_blackhole_detection2)) {
+  if (!GetQuicReloadableFlag(quic_default_enable_5rto_blackhole_detection2) ||
+      GetQuicReloadableFlag(quic_remove_blackhole_detection_experiments)) {
     return;
   }
   QuicConfig config;
@@ -10697,7 +10699,8 @@
 }
 
 TEST_P(QuicConnectionTest, 4RtoBlackholeDetection) {
-  if (!GetQuicReloadableFlag(quic_default_enable_5rto_blackhole_detection2)) {
+  if (!GetQuicReloadableFlag(quic_default_enable_5rto_blackhole_detection2) ||
+      GetQuicReloadableFlag(quic_remove_blackhole_detection_experiments)) {
     return;
   }
   QuicConfig config;
@@ -10724,7 +10727,8 @@
 }
 
 TEST_P(QuicConnectionTest, 6RtoBlackholeDetection) {
-  if (!GetQuicReloadableFlag(quic_default_enable_5rto_blackhole_detection2)) {
+  if (!GetQuicReloadableFlag(quic_default_enable_5rto_blackhole_detection2) ||
+      GetQuicReloadableFlag(quic_remove_blackhole_detection_experiments)) {
     return;
   }
   QuicConfig config;
@@ -15405,6 +15409,26 @@
   EXPECT_FALSE(connection_.GetRetransmissionAlarm()->IsSet());
 }
 
+TEST_P(QuicConnectionTest, CalculateNetworkBlackholeDelay) {
+  if (!IsDefaultTestConfiguration()) {
+    return;
+  }
+
+  const QuicTime::Delta kOneSec = QuicTime::Delta::FromSeconds(1);
+  const QuicTime::Delta kTwoSec = QuicTime::Delta::FromSeconds(2);
+  const QuicTime::Delta kFourSec = QuicTime::Delta::FromSeconds(4);
+
+  // Normal case: blackhole_delay longer than path_degrading_delay +
+  // 2*pto_delay.
+  EXPECT_EQ(QuicConnection::CalculateNetworkBlackholeDelay(kFourSec, kOneSec,
+                                                           kOneSec),
+            kFourSec);
+
+  EXPECT_EQ(QuicConnection::CalculateNetworkBlackholeDelay(kFourSec, kOneSec,
+                                                           kTwoSec),
+            QuicTime::Delta::FromSeconds(5));
+}
+
 }  // namespace
 }  // namespace test
 }  // namespace quic