You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "lhotari (via GitHub)" <gi...@apache.org> on 2025/07/25 15:19:45 UTC

[I] Flaky-test: ServiceUrlQuarantineTest.testServiceUrlHealthCheck [pulsar]

lhotari opened a new issue, #24565:
URL: https://github.com/apache/pulsar/issues/24565

   ### Search before reporting
   
   - [x] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.
   
   
   ### Example failure
   
   https://github.com/apache/pulsar/actions/runs/16524077290/job/46733436659?pr=24564#step:11:688
   
   ### Exception stacktrace
   
   ```text
   Error:  Tests run: 3, Failures: 1, Errors: 0, Skipped: 1, Time elapsed: 148.453 s <<< FAILURE! - in org.apache.pulsar.client.impl.ServiceUrlQuarantineTest
     Error:  org.apache.pulsar.client.impl.ServiceUrlQuarantineTest.testServiceUrlHealthCheck  Time elapsed: 10.131 s  <<< FAILURE!
     java.lang.AssertionError: expected [true] but found [false]
     	at org.testng.Assert.fail(Assert.java:110)
     	at org.testng.Assert.failNotEquals(Assert.java:1577)
     	at org.testng.Assert.assertTrue(Assert.java:56)
     	at org.testng.Assert.assertTrue(Assert.java:66)
     	at org.apache.pulsar.client.impl.ServiceUrlQuarantineTest.doTestServiceUrlResolve(ServiceUrlQuarantineTest.java:272)
     	at org.apache.pulsar.client.impl.ServiceUrlQuarantineTest.testServiceUrlHealthCheck(ServiceUrlQuarantineTest.java:202)
     	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
     	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
     	at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:139)
     	at org.testng.internal.invokers.InvokeMethodRunnable.runOne(InvokeMethodRunnable.java:47)
     	at org.testng.internal.invokers.InvokeMethodRunnable.call(InvokeMethodRunnable.java:76)
     	at org.testng.internal.invokers.InvokeMethodRunnable.call(InvokeMethodRunnable.java:11)
     	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
     	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
     	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
     	at java.base/java.lang.Thread.run(Thread.java:1583)
   ```
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
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-unsubscribe@pulsar.apache.org.apache.org

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


Re: [I] Flaky-test: ServiceUrlQuarantineTest.testServiceUrlHealthCheck [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari closed issue #24565: Flaky-test: ServiceUrlQuarantineTest.testServiceUrlHealthCheck
URL: https://github.com/apache/pulsar/issues/24565


-- 
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-unsubscribe@pulsar.apache.org

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


Re: [I] Flaky-test: ServiceUrlQuarantineTest.testServiceUrlHealthCheck [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
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-unsubscribe@pulsar.apache.org

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


Re: [I] Flaky-test: ServiceUrlQuarantineTest.testServiceUrlHealthCheck [pulsar]

Posted by "AuroraTwinkle (via GitHub)" <gi...@apache.org>.
AuroraTwinkle commented on issue #24565:
URL: https://github.com/apache/pulsar/issues/24565#issuecomment-3118721474

   > test was introduced in #24387, @AuroraTwinkle do you have a chance to fix this flaky test?
   
   Sorry,I will fix it later!


-- 
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-unsubscribe@pulsar.apache.org

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


Re: [I] Flaky-test: ServiceUrlQuarantineTest.testServiceUrlHealthCheck [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on issue #24565:
URL: https://github.com/apache/pulsar/issues/24565#issuecomment-3124463117

   @AuroraTwinkle very easy to reproduce
   
   <img width="679" height="313" alt="Image" src="https://github.com/user-attachments/assets/c56bbd87-ffb8-418d-b2bf-79e455249ed2" />
   
   


-- 
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-unsubscribe@pulsar.apache.org

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


Re: [I] Flaky-test: ServiceUrlQuarantineTest.testServiceUrlHealthCheck [pulsar]

Posted by "AuroraTwinkle (via GitHub)" <gi...@apache.org>.
AuroraTwinkle commented on issue #24565:
URL: https://github.com/apache/pulsar/issues/24565#issuecomment-3125100716

   > The test has some other problems. It's using static ports 6666 and 8888. In Pulsar tests, we use dynamic ports in tests to avoid port conflicts. Please revisit the test to use dynamic ports like 99% of the all other tests.
   > 
   > Other issues are using ports in the range of 100-1000 for binaryServiceUrlWithUnavailableNodes and httpServiceUrlWithUnavailableNodes since there might be other TCP servers on localhost on those ports and it's not a good idea to try to connect to those from test code.
   
   Ok, I will debug the issues and fix them. Thanks.


-- 
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-unsubscribe@pulsar.apache.org

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


Re: [I] Flaky-test: ServiceUrlQuarantineTest.testServiceUrlHealthCheck [pulsar]

Posted by "AuroraTwinkle (via GitHub)" <gi...@apache.org>.
AuroraTwinkle commented on issue #24565:
URL: https://github.com/apache/pulsar/issues/24565#issuecomment-3126412473

   Hi lari, I have submitted a new PR https://github.com/apache/pulsar/pull/24574 to fix this issue, would you please review it?
   
   


-- 
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-unsubscribe@pulsar.apache.org

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


Re: [I] Flaky-test: ServiceUrlQuarantineTest.testServiceUrlHealthCheck [pulsar]

Posted by "AuroraTwinkle (via GitHub)" <gi...@apache.org>.
AuroraTwinkle commented on issue #24565:
URL: https://github.com/apache/pulsar/issues/24565#issuecomment-3121297275

   > test was introduced in [#24387](https://github.com/apache/pulsar/pull/24387), [@AuroraTwinkle](https://github.com/AuroraTwinkle) do you have a chance to fix this flaky test?
   
   Hi, lari, I can't reproduce it, could you please try again?


-- 
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-unsubscribe@pulsar.apache.org

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


Re: [I] Flaky-test: ServiceUrlQuarantineTest.testServiceUrlHealthCheck [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on issue #24565:
URL: https://github.com/apache/pulsar/issues/24565#issuecomment-3118552197

   test was introduced in #24387, @AuroraTwinkle do you have a chance to fix this flaky test?


-- 
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-unsubscribe@pulsar.apache.org

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


Re: [I] Flaky-test: ServiceUrlQuarantineTest.testServiceUrlHealthCheck [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on issue #24565:
URL: https://github.com/apache/pulsar/issues/24565#issuecomment-3123350965

   > Hi, lari, I can't reproduce it, could you please try again?
   
   @AuroraTwinkle it continues to be flaky. 
   recent failure: https://github.com/apache/pulsar/actions/runs/16542487265/job/46785782931?pr=24569#step:11:694
   
   one first thing is to do in investigating flaky test is to use `@Test(invocationCount = 20)` to run the test 20 times in a row.
   
   


-- 
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-unsubscribe@pulsar.apache.org

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


Re: [I] Flaky-test: ServiceUrlQuarantineTest.testServiceUrlHealthCheck [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on issue #24565:
URL: https://github.com/apache/pulsar/issues/24565#issuecomment-3124711948

   The test has some other problems. It's using static ports 6666 and 8888. In Pulsar tests, we use dynamic ports in tests to avoid port conflicts. Please revisit the test to use dynamic ports like 99% of the all other tests.
   
   Other issues are using ports in the range of 100-1000 for binaryServiceUrlWithUnavailableNodes and httpServiceUrlWithUnavailableNodes since there might be other TCP servers on localhost on those ports and it's not a good idea to try to connect to those from test code.


-- 
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-unsubscribe@pulsar.apache.org

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