Technoboy- commented on code in PR #21008:
URL: https://github.com/apache/pulsar/pull/21008#discussion_r1298053315
##########
pulsar-broker/src/test/java/org/apache/pulsar/client/impl/RawReaderTest.java:
##########
@@ -133,43 +138,56 @@ public void testHasMessageAvailableWithoutBatch() throws
Exception {
}
}
Assert.assertTrue(keys.isEmpty());
+ reader.closeAsync().get(3, TimeUnit.SECONDS);
}
@Test
public void testHasMessageAvailableWithBatch() throws Exception {
int numKeys = 20;
- String topic = "persistent://my-property/my-ns/my-raw-topic";
+ String topic = "persistent://my-property/my-ns/" +
BrokerTestUtil.newUniqueName("reader");
Set<String> keys = publishMessages(topic, numKeys, true);
RawReader reader = RawReader.create(pulsarClient, topic,
subscription).get();
int messageCount = 0;
+ AtomicBoolean error = new AtomicBoolean(false);
+ List<MessageId> ids = new ArrayList<>();
+ List<String> keys2 = new ArrayList<>();
while (true) {
boolean hasMsg = reader.hasMessageAvailableAsync().get();
if (hasMsg && (messageCount == numKeys)) {
- Assert.fail("HasMessageAvailable shows still has message when
there is no message");
+ error.set(true);
Review Comment:
I will revert this when find the root cause.
--
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]