File tree Expand file tree Collapse file tree
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3101,7 +3101,13 @@ public void partitionedTopicsCursorReset(String topicName) throws Exception {
31013101 assertEquals (receivedMessages .size (), 0 );
31023102
31033103 consumer .close ();
3104- admin .topics ().deleteSubscription (topicName , "my-sub" );
3104+ // consumer.close() returns when the close request is dispatched, but the broker may not
3105+ // have processed the disconnect yet, so deleteSubscription can still see active consumers
3106+ // and return HTTP 412. Retry until the broker has detected the disconnect.
3107+ final String topicNameFinal = topicName ;
3108+ Awaitility .await ()
3109+ .ignoreExceptionsInstanceOf (PulsarAdminException .PreconditionFailedException .class )
3110+ .untilAsserted (() -> admin .topics ().deleteSubscription (topicNameFinal , "my-sub" ));
31053111 admin .topics ().deletePartitionedTopic (topicName );
31063112 }
31073113
You can’t perform that action at this time.
0 commit comments