You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by lh...@apache.org on 2022/04/27 06:54:00 UTC
[pulsar] branch master updated: [fix][Flaky-test] Fix bug in method testConsumerImpl of AutoScaledReceiverQueueSizeTest (#15330)
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 3145c4048a1 [fix][Flaky-test] Fix bug in method testConsumerImpl of AutoScaledReceiverQueueSizeTest (#15330)
3145c4048a1 is described below
commit 3145c4048a104177b5ff9f3329281eebe8e615fb
Author: codertmy <49...@users.noreply.github.com>
AuthorDate: Wed Apr 27 14:53:54 2022 +0800
[fix][Flaky-test] Fix bug in method testConsumerImpl of AutoScaledReceiverQueueSizeTest (#15330)
* fix bug of AutoScaledReceiverQueueSizeTest'method testConsumerImpl
* fix run exception
Co-authored-by: tmytangmingyang <tm...@didiglobal.com>
---
.../org/apache/pulsar/client/impl/AutoScaledReceiverQueueSizeTest.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/AutoScaledReceiverQueueSizeTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/AutoScaledReceiverQueueSizeTest.java
index ec9467794a5..30794a2ba8a 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/AutoScaledReceiverQueueSizeTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/AutoScaledReceiverQueueSizeTest.java
@@ -66,8 +66,8 @@ public class AutoScaledReceiverQueueSizeTest extends MockedPulsarServiceBaseTest
byte[] data = "data".getBytes(StandardCharsets.UTF_8);
producer.send(data);
- Assert.assertNotNull(consumer.receive());
Awaitility.await().until(consumer.scaleReceiverQueueHint::get);
+ Assert.assertNotNull(consumer.receive());
log.info("getCurrentReceiverQueueSize={}", consumer.getCurrentReceiverQueueSize());
//this will trigger receiver queue size expanding.
@@ -80,6 +80,7 @@ public class AutoScaledReceiverQueueSizeTest extends MockedPulsarServiceBaseTest
for (int i = 0; i < 5; i++) {
producer.send(data);
producer.send(data);
+ Awaitility.await().until(consumer.scaleReceiverQueueHint::get);
Assert.assertNotNull(consumer.receive());
Assert.assertNotNull(consumer.receive());
// queue maybe full, but no empty receive, so no expanding