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 6832732836a [fix][test] Fix flaky test CompactionReaderImplTest
(#19222)
6832732836a is described below
commit 6832732836a8d3742a5185d3d2647401d1b44e45
Author: Heesung Sohn <[email protected]>
AuthorDate: Fri Jan 13 11:53:27 2023 -0800
[fix][test] Fix flaky test CompactionReaderImplTest (#19222)
---
.../java/org/apache/pulsar/client/impl/CompactionReaderImplTest.java | 5 +++++
1 file changed, 5 insertions(+)
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 6a490c918e7..0cd841cba7f 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
@@ -65,6 +65,11 @@ public class CompactionReaderImplTest extends
MockedPulsarServiceBaseTest {
public void test() throws Exception {
String topic = "persistent://my-property/my-ns/my-compact-topic";
+
+ // subscribe before sending anything, so that we get all messages
+ @Cleanup
+ var consumer = pulsarClient.newConsumer().topic(topic)
+ .subscriptionName("sub1").readCompacted(true).subscribe();
int numKeys = 5;
@Cleanup
Producer<String> producer =
pulsarClient.newProducer(Schema.STRING).topic(topic).create();