Copilot commented on code in PR #10565:
URL: https://github.com/apache/rocketmq/pull/10565#discussion_r3503195210


##########
common/src/test/java/org/apache/rocketmq/common/KeyBuilderTest.java:
##########
@@ -60,4 +60,30 @@ public void testIsPopRetryTopicV2() {
         String popRetryTopicV1 = KeyBuilder.buildPopRetryTopicV1(topic, group);
         
assertThat(KeyBuilder.isPopRetryTopicV2(popRetryTopicV1)).isEqualTo(false);
     }
+
+    @Test
+    public void testV1CollisionExample() {
+        // Demonstrates the V1 naming collision: different (group, topic) 
pairs produce the same retry topic
+        String retryA = KeyBuilder.buildPopRetryTopicV1("Order", 
"MyGroup_Order");
+        String retryB = KeyBuilder.buildPopRetryTopicV1("Order", "MyGroup");
+        // retryA = %RETRY%MyGroup_Order_Order, retryB = %RETRY%MyGroup_Order
+        // A more precise collision: group="A_B" topic="C" vs group="A" 
topic="B_C"

Review Comment:
   The first example in this test (retryA/retryB) does not actually demonstrate 
a collision and the variables are unused, which makes the test intent harder to 
follow. Consider removing that snippet and keeping only the real collision case 
you assert below.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to