Fix flaky quic e2e test EndToEndTest.ClientPortMigrationOnPathDegrading.

The test was flaky because the test server starts to drop packets before sending a NEW_CONNECTION_ID frame back to the client after 1st port migration. So the 2nd path degrading couldn't kick off another probing.

PiperOrigin-RevId: 622248973
diff --git a/quiche/quic/core/http/end_to_end_test.cc b/quiche/quic/core/http/end_to_end_test.cc
index 4a589ef..b644d0d 100644
--- a/quiche/quic/core/http/end_to_end_test.cc
+++ b/quiche/quic/core/http/end_to_end_test.cc
@@ -5452,6 +5452,8 @@
   EXPECT_EQ(1u, GetClientConnection()->GetStats().num_path_response_received);
   size_t pto_count = GetClientConnection()->GetStats().pto_count;
 
+  // Wait for new connection id to be received.
+  WaitForNewConnectionIds();
   // Use 1 PTO to detect path degrading more aggressively.
   client_->client()->EnablePortMigrationUponPathDegrading({1});
   new_writer->set_peer_address_to_drop(new_self_addr1);
diff --git a/quiche/quic/tools/quic_client_base.cc b/quiche/quic/tools/quic_client_base.cc
index 694b681..03001fd 100644
--- a/quiche/quic/tools/quic_client_base.cc
+++ b/quiche/quic/tools/quic_client_base.cc
@@ -589,6 +589,9 @@
           network_helper_->GetLatestClientAddress(), session_->peer_address()),
       std::make_unique<QuicClientSocketMigrationValidationResultDelegate>(this),
       PathValidationReason::kPortMigration);
+  if (!session()->HasPendingPathValidation()) {
+    QUIC_CODE_COUNT(fail_to_probe_new_path_after_current_one_degraded);
+  }
 }
 
 }  // namespace quic