Make new QuicPacketCreatorTests consistent with other instances of EXPECT_QUIC_BUG.

The BufferOverflow tests were failing on a checkout of OSS QUICHE. This fixes the problem by following the EXPECT_QUIC_BUG template elsewhere in the file.

PiperOrigin-RevId: 895899483
diff --git a/quiche/quic/core/quic_packet_creator_test.cc b/quiche/quic/core/quic_packet_creator_test.cc
index c3d54b7..991534e 100644
--- a/quiche/quic/core/quic_packet_creator_test.cc
+++ b/quiche/quic/core/quic_packet_creator_test.cc
@@ -4588,7 +4588,8 @@
 }
 
 TEST_P(QuicPacketCreatorTest, InitialPacketBufferOverflow) {
-  if (!VersionIsIetfQuic(creator_.transport_version())) {
+  // EXPECT_QUIC_BUG tests are expensive so only run one instance of them.
+  if (!IsDefaultTestConfiguration()) {
     return;
   }
   SetQuicReloadableFlag(quic_clear_packet_on_serialization_failure, true);
@@ -4596,11 +4597,14 @@
   QuicCoalescedPacket coalesced;
   EXPECT_TRUE(BuildAndCoalescePacket(coalesced, ENCRYPTION_INITIAL));
   char buffer[kMaxOutgoingPacketSize];
-  EXPECT_CALL(framer_visitor_, OnError);
-  EXPECT_CALL(delegate_, OnUnrecoverableError);
-  EXPECT_QUIC_BUG(creator_.SerializeCoalescedPacket(coalesced, buffer,
-                                                    kMaxOutgoingPacketSize - 1),
-                  "Client: Failed to encrypt packet number 1");
+  EXPECT_QUIC_BUG(
+      {
+        EXPECT_CALL(framer_visitor_, OnError);
+        EXPECT_CALL(delegate_, OnUnrecoverableError);
+        creator_.SerializeCoalescedPacket(coalesced, buffer,
+                                          kMaxOutgoingPacketSize - 1);
+      },
+      "Client: Failed to encrypt packet number 1");
 }
 
 TEST_P(QuicPacketCreatorTest, SendSconeIndicatorInClientInitial) {
@@ -4825,7 +4829,8 @@
 }
 
 TEST_P(QuicPacketCreatorTest, SconePacketWithInitialPacketBufferOverflow) {
-  if (!VersionIsIetfQuic(creator_.transport_version())) {
+  // EXPECT_QUIC_BUG tests are expensive so only run one instance of them.
+  if (!IsDefaultTestConfiguration()) {
     return;
   }
   SetQuicReloadableFlag(quic_clear_packet_on_serialization_failure, true);
@@ -4834,11 +4839,14 @@
   QuicCoalescedPacket coalesced;
   EXPECT_TRUE(BuildAndCoalescePacket(coalesced, ENCRYPTION_INITIAL));
   char buffer[kMaxOutgoingPacketSize];
-  EXPECT_CALL(framer_visitor_, OnError);
-  EXPECT_CALL(delegate_, OnUnrecoverableError);
-  EXPECT_QUIC_BUG(creator_.SerializeCoalescedPacket(coalesced, buffer,
-                                                    kMaxOutgoingPacketSize - 1),
-                  "Client: Failed to encrypt packet number 1");
+  EXPECT_QUIC_BUG(
+      {
+        EXPECT_CALL(framer_visitor_, OnError);
+        EXPECT_CALL(delegate_, OnUnrecoverableError);
+        creator_.SerializeCoalescedPacket(coalesced, buffer,
+                                          kMaxOutgoingPacketSize - 1);
+      },
+      "Client: Failed to encrypt packet number 1");
 }
 
 }  // namespace