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 fe5dafdf516 [fix][test]Fix flaky test increase the delay time (#23046)
fe5dafdf516 is described below
commit fe5dafdf5168d17f690ffdd37d458c58a8dc0abf
Author: congbo <[email protected]>
AuthorDate: Wed Jul 17 20:11:01 2024 +0800
[fix][test]Fix flaky test increase the delay time (#23046)
---
.../apache/pulsar/client/impl/TransactionEndToEndTest.java | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git
a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/TransactionEndToEndTest.java
b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/TransactionEndToEndTest.java
index 56cf0533140..812f8fd571c 100644
---
a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/TransactionEndToEndTest.java
+++
b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/TransactionEndToEndTest.java
@@ -1654,24 +1654,24 @@ public class TransactionEndToEndTest extends
TransactionTestBase {
for (int i = 0; i < 10; i++) {
producer.newMessage(transaction)
.value("msg-" + i)
- .deliverAfter(5, TimeUnit.SECONDS)
+ .deliverAfter(7, TimeUnit.SECONDS)
.sendAsync();
}
producer.flush();
transaction.commit().get();
-
- // Failover consumer will receive the messages immediately while
- // the shared consumer will get them after the delay
- Message<String> msg =
sharedConsumer.receive(waitTimeForCannotReceiveMsgInSec, TimeUnit.SECONDS);
- assertNull(msg);
-
+ Message<String> msg;
for (int i = 0; i < 10; i++) {
msg = failoverConsumer.receive(waitTimeForCanReceiveMsgInSec,
TimeUnit.SECONDS);
assertEquals(msg.getValue(), "msg-" + i);
}
+ // Failover consumer will receive the messages immediately while
+ // the shared consumer will get them after the delay
+ msg = sharedConsumer.receive(waitTimeForCannotReceiveMsgInSec,
TimeUnit.SECONDS);
+ assertNull(msg);
+
Set<String> receivedMsgs = new TreeSet<>();
for (int i = 0; i < 10; i++) {
msg = sharedConsumer.receive(waitTimeForCanReceiveMsgInSec,
TimeUnit.SECONDS);