gaoran10 commented on a change in pull request #11934:
URL: https://github.com/apache/pulsar/pull/11934#discussion_r702970026
##########
File path:
pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/TopicTransactionBufferRecoverTest.java
##########
@@ -403,4 +405,66 @@ private void testTopicTransactionBufferDeleteAbort()
throws Exception {
}
assertTrue(exist);
}
+
+ @Test
+ public void clearTransactionBufferSnapshotTest() throws Exception {
+ String topic = NAMESPACE1 + "/tb-snapshot-delete-" +
RandomUtils.nextInt();
+
+ @Cleanup
+ Producer<byte[]> producer = pulsarClient
+ .newProducer()
+ .topic(topic)
+ .sendTimeout(0, TimeUnit.SECONDS)
+ .create();
+
+ Transaction txn = pulsarClient.newTransaction()
+ .withTransactionTimeout(5, TimeUnit.SECONDS)
+ .build().get();
+ producer.newMessage(txn).value("test".getBytes()).sendAsync();
+ producer.newMessage(txn).value("test".getBytes()).sendAsync();
+ txn.commit().get();
+
+ // wait for take snapshot
+ Thread.sleep(1000 * 3);
Review comment:
Ok, I'll fix this.
--
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]