Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
poorbarcode committed Feb 6, 2025
1 parent 19f8f5c commit b2fe24d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -689,8 +689,9 @@ void testAsyncReadWithMaxSizeByte() throws Exception {
ledger.addEntry(new byte[1024]);
}

// First time, since we don't have info, we'll get 1 single entry
readAndCheck(cursor, 10, 3 * 1024, 1);
// Since https://github.com/apache/pulsar/pull/23931 improved the performance of delivery, the consumer
// will get more messages than before(it only receives 1 messages at the first delivery),
readAndCheck(cursor, 10, 3 * 1024, 3);
// We should only return 3 entries, based on the max size
readAndCheck(cursor, 20, 3 * 1024, 3);
// If maxSize is < avg, we should get 1 entry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,10 @@ public void testAvgMessagesPerEntry() throws Exception {
metadataConsumer.put("matchValueReschedule", "producer2");
@Cleanup
Consumer<String> consumer = pulsarClient.newConsumer(Schema.STRING).topic(topic).properties(metadataConsumer)
// Since https://github.com/apache/pulsar/pull/23931 improved the performance of delivery, the consumer
// will get more messages than before(it only receives 1 messages at the first delivery), we set queue
// size to `1` to keep the test passing.
.receiverQueueSize(1)
.subscriptionName(subName).subscriptionInitialPosition(SubscriptionInitialPosition.Earliest).subscribe();

int counter = 0;
Expand Down

0 comments on commit b2fe24d

Please sign in to comment.