Skip to content

Commit

Permalink
[fix][flaky-test]PerformanceTransactionTest.testConsumeTxnMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
poorbarcode committed Sep 26, 2022
1 parent f0aeb5a commit 7b934dc
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public void testProduceTxnMessage() throws InterruptedException, PulsarClientExc

@Test
public void testConsumeTxnMessage() throws Exception {
String argString = "%s -r 10 -u %s -txn -ss %s -st %s -sp %s -ntxn %d";
String argString = "%s -r 10 -u %s -txn -ss %s -st %s -sp %s -ntxn %d -tto 5";
String subName = "sub";
String topic = testTopic + UUID.randomUUID();
String args = String.format(argString, topic, pulsar.getBrokerServiceUrl(), subName,
Expand All @@ -222,7 +222,7 @@ public void testConsumeTxnMessage() throws Exception {
} catch (Exception e) {
e.printStackTrace();
}
});
}, "Performance_Consumer_Task");
thread.start();
thread.join();

Expand All @@ -240,6 +240,7 @@ public void testConsumeTxnMessage() throws Exception {
for (int i = 0; i < 5; i++) {
Message<byte[]> message = consumer.receive(2, TimeUnit.SECONDS);
Assert.assertNotNull(message);
consumer.acknowledge(message);
}
Message<byte[]> message = consumer.receive(2, TimeUnit.SECONDS);
Assert.assertNull(message);
Expand Down

0 comments on commit 7b934dc

Please sign in to comment.