ghostly72 commented on PR #15873:
URL: https://github.com/apache/dubbo/pull/15873#issuecomment-3665218845

   > `AbstractRegistryTest` should be fixed if apply this pr,
   > 
   > ```
   > Error: ERROR] 
org.apache.dubbo.registry.support.AbstractRegistryTest.allTest -- Time elapsed: 
0.008 s <<< FAILURE!
   > 60514-org.opentest4j.AssertionFailedError: expected: <false> but was: 
<true>
   > 60515-     at 
org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
   > 60516-     at 
org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
   > 60517-     at 
org.junit.jupiter.api.AssertFalse.failNotFalse(AssertFalse.java:63)
   > 60518-     at 
org.junit.jupiter.api.AssertFalse.assertFalse(AssertFalse.java:36)
   > 60519-     at 
org.junit.jupiter.api.AssertFalse.assertFalse(AssertFalse.java:31)
   > 60520-     at 
org.junit.jupiter.api.Assertions.assertFalse(Assertions.java:231)
   > 60521-     at 
org.apache.dubbo.registry.support.AbstractRegistryTest.allTest(AbstractRegistryTest.java:516)
   > 60522-     at java.lang.reflect.Method.invoke(Method.java:498)
   > 60523-     at java.util.ArrayList.forEach(ArrayList.java:1259)
   > 60524-     at java.util.ArrayList.forEach(ArrayList.java:1259)
   > 60525-
   > Error: ERROR] 
org.apache.dubbo.registry.support.AbstractRegistryTest.lookupTest -- Time 
elapsed: 0.005 s <<< FAILURE!
   > 60527-org.opentest4j.AssertionFailedError: expected: <false> but was: 
<true>
   > 60528-     at 
org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
   > 60529-     at 
org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
   > 60530-     at 
org.junit.jupiter.api.AssertFalse.failNotFalse(AssertFalse.java:63)
   > 60531-     at 
org.junit.jupiter.api.AssertFalse.assertFalse(AssertFalse.java:36)
   > 60532-     at 
org.junit.jupiter.api.AssertFalse.assertFalse(AssertFalse.java:31)
   > 60533-     at 
org.junit.jupiter.api.Assertions.assertFalse(Assertions.java:231)
   > 60534-     at 
org.apache.dubbo.registry.support.AbstractRegistryTest.lookupTest(AbstractRegistryTest.java:485)
   > 60535-     at java.lang.reflect.Method.invoke(Method.java:498)
   > 60536-     at java.util.ArrayList.forEach(ArrayList.java:1259)
   > 60537-     at java.util.ArrayList.forEach(ArrayList.java:1259)
   > ```
   
   yea i saw the test file and found that lookuptest expects to return a list 
that does not contain testUrl. but the modified subscribe() method, notifies 
from cache immediately when local cache data is available. That means the cache 
is loaded and lookup() might return testUrl, making the assertion fail. 
   
   so should i try and make some changes in the test file or else should i 
modify my code?
   
   also in the same file in  `alltest()`, there is a line checking (line 520)
   ```abstractRegistry.unsubscribe(testUrl, listener);
      
Assertions.assertFalse(abstractRegistry.getSubscribed().containsKey(listener));
   ```
   but shouldnt it be `containsKey(testUrl)`  instead of checking if it 
contains listener?
   
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to