lhotari opened a new pull request, #25847:
URL: https://github.com/apache/pulsar/pull/25847

   ### Motivation
   
   `AdminApiTest.partitionedTopicsCursorReset` is flaky in CI. Recent example: 
[PR #25844 run 26175306430 job 
77005757000](https://github.com/apache/pulsar/actions/runs/26175306430/job/77005757000).
   
   ```
   Gradle suite > Gradle test > org.apache.pulsar.broker.admin.AdminApiTest > 
partitionedTopicsCursorReset[2](topic_+&*%{}() \$@#^%) FAILED
       
org.apache.pulsar.client.admin.PulsarAdminException$PreconditionFailedException:
 Subscription has active connected consumers
           at 
org.apache.pulsar.broker.admin.AdminApiTest.partitionedTopicsCursorReset(AdminApiTest.java:3104)
   
           Caused by:
           javax.ws.rs.ClientErrorException: HTTP 412 {"reason":"Subscription 
has active connected consumers"}
   ```
   
   `consumer.close()` returns once the close request has been dispatched to the 
broker, but the broker may not yet have processed the disconnect when the test 
immediately calls `admin.topics().deleteSubscription(...)`. The broker's 
precondition check still sees a connected consumer and returns HTTP 412.
   
   ### Modifications
   
   Wrap the `deleteSubscription` call in 
`Awaitility.await().ignoreExceptionsInstanceOf(PreconditionFailedException.class).untilAsserted(...)`
 so the test retries the delete until the broker has detected the consumer 
disconnect.
   
   ### Verifying this change
   
   - [x] Make sure that the change passes the CI checks.
   
   This change is already covered by existing tests, such as *the modified 
`partitionedTopicsCursorReset` test itself*.


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