This is an automated email from the ASF dual-hosted git repository.

lhotari 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 f23363c6f50  Fix flaky test CompactionReaderImplTest(wait until the 
consumerFuture completes) (#19238)
f23363c6f50 is described below

commit f23363c6f50b89b7dcb658c06ffaaf496bb65a86
Author: Heesung Sohn <[email protected]>
AuthorDate: Sun Jan 15 23:41:51 2023 -0800

     Fix flaky test CompactionReaderImplTest(wait until the consumerFuture 
completes) (#19238)
---
 .../java/org/apache/pulsar/client/impl/CompactionReaderImplTest.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/CompactionReaderImplTest.java
 
b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/CompactionReaderImplTest.java
index 0cd841cba7f..1942e948411 100644
--- 
a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/CompactionReaderImplTest.java
+++ 
b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/CompactionReaderImplTest.java
@@ -77,9 +77,11 @@ public class CompactionReaderImplTest extends 
MockedPulsarServiceBaseTest {
             producer.newMessage().key("key:" + i).value("value" + i).send();
         }
 
+        var consumerFuture = new CompletableFuture();
         @Cleanup
         CompactionReaderImpl<String> reader = CompactionReaderImpl
-                .create((PulsarClientImpl) pulsarClient, Schema.STRING, topic, 
new CompletableFuture(), null);
+                .create((PulsarClientImpl) pulsarClient, Schema.STRING, topic, 
consumerFuture, null);
+        consumerFuture.join();
 
         ConsumerBase consumerBase = spy(reader.getConsumer());
         FieldUtils.writeDeclaredField(

Reply via email to