Migration from QUIC_BUG to QUIC_BUG_V2(bug_id).

Per go/gfe-bug-improvements GFE_BUGs are getting stable IDs to allow for monitoring and alerting. Existing QUIC_BUG instances are changed to have `quic_bug_n_m` ID, where `n` is unique for each file, and `m` is a counter within each file, so we get `QUIC_BUG_V2(quic_bug_123_2)`

PiperOrigin-RevId: 361667817
Change-Id: I675af8c174ca089f245af4507fa1d6bbef47b921
diff --git a/quic/test_tools/crypto_test_utils.cc b/quic/test_tools/crypto_test_utils.cc
index 23f24d6..f00f3d6 100644
--- a/quic/test_tools/crypto_test_utils.cc
+++ b/quic/test_tools/crypto_test_utils.cc
@@ -472,7 +472,7 @@
       : cert_(cert), hash_(hash), index_(index) {}
 
   absl::string_view GetCommonHashes() const override {
-    QUIC_BUG << "not implemented";
+    QUIC_BUG_V2(quic_bug_10142_1) << "not implemented";
     return absl::string_view();
   }
 
diff --git a/quic/test_tools/fake_proof_source_handle.cc b/quic/test_tools/fake_proof_source_handle.cc
index 5bba072..506d647 100644
--- a/quic/test_tools/fake_proof_source_handle.cc
+++ b/quic/test_tools/fake_proof_source_handle.cc
@@ -176,7 +176,8 @@
     bool ok = chain && !chain->certs.empty();
     callback_->OnSelectCertificateDone(ok, /*is_sync=*/false, chain.get());
   } else {
-    QUIC_BUG << "Unexpected action: " << static_cast<int>(action_);
+    QUIC_BUG_V2(quic_bug_10139_1)
+        << "Unexpected action: " << static_cast<int>(action_);
   }
 }
 
@@ -200,7 +201,8 @@
                                       result.signature,
                                       std::move(result.details));
   } else {
-    QUIC_BUG << "Unexpected action: " << static_cast<int>(action_);
+    QUIC_BUG_V2(quic_bug_10139_2)
+        << "Unexpected action: " << static_cast<int>(action_);
   }
 }
 
diff --git a/quic/test_tools/quic_session_peer.cc b/quic/test_tools/quic_session_peer.cc
index 4a8c8ca..a0aa3c5 100644
--- a/quic/test_tools/quic_session_peer.cc
+++ b/quic/test_tools/quic_session_peer.cc
@@ -40,7 +40,8 @@
 void QuicSessionPeer::SetMaxOpenIncomingStreams(QuicSession* session,
                                                 uint32_t max_streams) {
   if (VersionHasIetfQuicFrames(session->transport_version())) {
-    QUIC_BUG << "SetmaxOpenIncomingStreams deprecated for IETF QUIC";
+    QUIC_BUG_V2(quic_bug_10193_1)
+        << "SetmaxOpenIncomingStreams deprecated for IETF QUIC";
     session->ietf_streamid_manager_.SetMaxOpenIncomingUnidirectionalStreams(
         max_streams);
     session->ietf_streamid_manager_.SetMaxOpenIncomingBidirectionalStreams(
@@ -75,7 +76,8 @@
 void QuicSessionPeer::SetMaxOpenOutgoingStreams(QuicSession* session,
                                                 uint32_t max_streams) {
   if (VersionHasIetfQuicFrames(session->transport_version())) {
-    QUIC_BUG << "SetmaxOpenOutgoingStreams deprecated for IETF QUIC";
+    QUIC_BUG_V2(quic_bug_10193_2)
+        << "SetmaxOpenOutgoingStreams deprecated for IETF QUIC";
     return;
   }
   session->stream_id_manager_.set_max_open_outgoing_streams(max_streams);
diff --git a/quic/test_tools/quic_test_client.cc b/quic/test_tools/quic_test_client.cc
index d1c1272..8480b04 100644
--- a/quic/test_tools/quic_test_client.cc
+++ b/quic/test_tools/quic_test_client.cc
@@ -634,7 +634,7 @@
 
 void QuicTestClient::Connect() {
   if (connected()) {
-    QUIC_BUG << "Cannot connect already-connected client";
+    QUIC_BUG_V2(quic_bug_10133_1) << "Cannot connect already-connected client";
     return;
   }
   if (!connect_attempted_) {
diff --git a/quic/test_tools/quic_test_utils.cc b/quic/test_tools/quic_test_utils.cc
index 035680c..cf42f62 100644
--- a/quic/test_tools/quic_test_utils.cc
+++ b/quic/test_tools/quic_test_utils.cc
@@ -1535,11 +1535,11 @@
     const char* source_connection_id_bytes,
     uint8_t source_connection_id_length) {
   if (packet_bytes == nullptr) {
-    QUIC_BUG << "Invalid packet_bytes";
+    QUIC_BUG_V2(quic_bug_10256_1) << "Invalid packet_bytes";
     return false;
   }
   if (packet_length_out == nullptr) {
-    QUIC_BUG << "Invalid packet_length_out";
+    QUIC_BUG_V2(quic_bug_10256_2) << "Invalid packet_length_out";
     return false;
   }
   QuicConnectionId source_connection_id(source_connection_id_bytes,
@@ -1550,12 +1550,14 @@
           /*ietf_quic=*/true, /*use_length_prefix=*/true,
           ParsedQuicVersionVector{});
   if (!encrypted_packet) {
-    QUIC_BUG << "Failed to create version negotiation packet";
+    QUIC_BUG_V2(quic_bug_10256_3)
+        << "Failed to create version negotiation packet";
     return false;
   }
   if (*packet_length_out < encrypted_packet->length()) {
-    QUIC_BUG << "Invalid *packet_length_out " << *packet_length_out << " < "
-             << encrypted_packet->length();
+    QUIC_BUG_V2(quic_bug_10256_4)
+        << "Invalid *packet_length_out " << *packet_length_out << " < "
+        << encrypted_packet->length();
     return false;
   }
   *packet_length_out = encrypted_packet->length();
@@ -1569,20 +1571,21 @@
     char* destination_connection_id_bytes,
     uint8_t* destination_connection_id_length_out) {
   if (packet_bytes == nullptr) {
-    QUIC_BUG << "Invalid packet_bytes";
+    QUIC_BUG_V2(quic_bug_10256_5) << "Invalid packet_bytes";
     return false;
   }
   if (packet_length < kMinPacketSizeForVersionNegotiation ||
       packet_length > 65535) {
-    QUIC_BUG << "Invalid packet_length";
+    QUIC_BUG_V2(quic_bug_10256_6) << "Invalid packet_length";
     return false;
   }
   if (destination_connection_id_bytes == nullptr) {
-    QUIC_BUG << "Invalid destination_connection_id_bytes";
+    QUIC_BUG_V2(quic_bug_10256_7) << "Invalid destination_connection_id_bytes";
     return false;
   }
   if (destination_connection_id_length_out == nullptr) {
-    QUIC_BUG << "Invalid destination_connection_id_length_out";
+    QUIC_BUG_V2(quic_bug_10256_8)
+        << "Invalid destination_connection_id_length_out";
     return false;
   }
 
@@ -1602,16 +1605,18 @@
       &parsed_version, &destination_connection_id, &source_connection_id,
       &retry_token_present, &retry_token, &detailed_error);
   if (error != QUIC_NO_ERROR) {
-    QUIC_BUG << "Failed to parse packet: " << detailed_error;
+    QUIC_BUG_V2(quic_bug_10256_9)
+        << "Failed to parse packet: " << detailed_error;
     return false;
   }
   if (!version_present) {
-    QUIC_BUG << "Packet is not a long header";
+    QUIC_BUG_V2(quic_bug_10256_10) << "Packet is not a long header";
     return false;
   }
   if (*destination_connection_id_length_out <
       destination_connection_id.length()) {
-    QUIC_BUG << "destination_connection_id_length_out too small";
+    QUIC_BUG_V2(quic_bug_10256_11)
+        << "destination_connection_id_length_out too small";
     return false;
   }
   *destination_connection_id_length_out = destination_connection_id.length();
diff --git a/quic/test_tools/quic_test_utils.h b/quic/test_tools/quic_test_utils.h
index 657d117..6fef85b 100644
--- a/quic/test_tools/quic_test_utils.h
+++ b/quic/test_tools/quic_test_utils.h
@@ -1974,7 +1974,7 @@
   }
 
   bool SetPreliminaryKey(absl::string_view /*key*/) override {
-    QUIC_BUG << "should not be called";
+    QUIC_BUG_V2(quic_bug_10230_1) << "should not be called";
     return false;
   }