lhotari commented on issue #24565:
URL: https://github.com/apache/pulsar/issues/24565#issuecomment-3124708774

   odd, that some test runs have taken very long time (above example), but 
being successful. I didn't investigate that.
   
   In test assertions, I'd recommend using AssertJ so that test failures would 
be more descriptive.
   For example, this assertion:
   
https://github.com/apache/pulsar/blob/d6071c71098a5e55db03ce4af83753a3d18c9a34/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ServiceUrlQuarantineTest.java#L272
   The error message is useless when the test fails.
   With AssertJ that becomes
   ```java
   assertThat(expectedHealthyAddresses).contains(resolver.resolveHost())
   ```
   The import for `assertThat` is `import static 
org.assertj.core.api.Assertions.assertThat;`
   
   That gives a nice error message such as
   
   ```
   java.lang.AssertionError: 
   Expecting HashSet:
     [127.0.0.1/<unresolved>:6666]
   to contain:
     [host1/<unresolved>:6651]
   but could not find the following element(s):
     [host1/<unresolved>:6651]
   ```
   
   


-- 
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: commits-unsubscr...@pulsar.apache.org

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

Reply via email to