You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/12/12 07:02:52 UTC

[GitHub] [dubbo] AlbumenJ commented on a diff in pull request #11115: testHashCode is a flaky Test

AlbumenJ commented on code in PR #11115:
URL: https://github.com/apache/dubbo/pull/11115#discussion_r1045463560


##########
dubbo-common/src/test/java/org/apache/dubbo/common/URLTest.java:
##########
@@ -1023,7 +1023,7 @@ void testHashcode() {
         URL url2 = URL.valueOf("consumer://30.225.20.150/org.apache.dubbo.rpc.service.GenericService?application=" +
             "dubbo-demo-api-consumer&category=consumers&check=false&dubbo=2.0.2&generic=true&interface=" +
             "org.apache.dubbo.demo.DemoService&pid=7375&side=consumer&sticky=false&timestamp=2299556506417");
-        assertEquals(url1.hashCode(), url2.hashCode());
+        assertTrue(url1.equals(url2) && url2.equals(url1));

Review Comment:
   The test case here is to check the hashCode are the same.
   For `equals` test, is in other cases.



-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org