This is an automated email from the ASF dual-hosted git repository.
xiangying pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new 9d6ac0ed4f1 [fix][test] Fix flaky
MultiTopicsReaderTest.testMultiNonPartitionedTopicWithRollbackDuration (#24318)
9d6ac0ed4f1 is described below
commit 9d6ac0ed4f1a32031a041dda3fdae15e823f96e8
Author: hanmz <[email protected]>
AuthorDate: Wed May 21 20:51:22 2025 +0800
[fix][test] Fix flaky
MultiTopicsReaderTest.testMultiNonPartitionedTopicWithRollbackDuration (#24318)
### Motivation

The root cause of this problem is that the `reader` is not cleaned up after
the unit test `shouldSupportCancellingReadNextAsync` is executed.
### Modifications
Add @Cleanup on `reader` in test `shouldSupportCancellingReadNextAsync`.
---
.../test/java/org/apache/pulsar/client/impl/MultiTopicsReaderTest.java | 1 +
1 file changed, 1 insertion(+)
diff --git
a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/MultiTopicsReaderTest.java
b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/MultiTopicsReaderTest.java
index d9bbc6a9d74..feffda3cf5d 100644
---
a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/MultiTopicsReaderTest.java
+++
b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/MultiTopicsReaderTest.java
@@ -629,6 +629,7 @@ public class MultiTopicsReaderTest extends
MockedPulsarServiceBaseTest {
void shouldSupportCancellingReadNextAsync() throws Exception {
String topic = "persistent://my-property/my-ns/my-reader-topic" +
UUID.randomUUID();
admin.topics().createPartitionedTopic(topic, 3);
+ @Cleanup
MultiTopicsReaderImpl<byte[]> reader = (MultiTopicsReaderImpl<byte[]>)
pulsarClient.newReader()
.topic(topic)
.startMessageId(MessageId.earliest)