liangyepianzhou commented on a change in pull request #11438:
URL: https://github.com/apache/pulsar/pull/11438#discussion_r675378872



##########
File path: 
pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/TransactionTest.java
##########
@@ -139,4 +141,22 @@ protected void cleanup() throws Exception {
                 .enableBatchIndexAcknowledgment(true)
                 .subscribe();
     }
+
+    @Test
+    public void testGetTxnID() throws Exception {
+        Awaitility.await().atMost(4, TimeUnit.SECONDS).until(()->{
+            try {
+                Transaction transaction = pulsarClient.newTransaction()
+                        .withTransactionTimeout(0, 
TimeUnit.SECONDS).build().get();
+            } catch (Exception e){
+                return false;
+            }
+            return true;
+        });
+        Transaction transaction = pulsarClient.newTransaction()
+                .withTransactionTimeout(0, TimeUnit.SECONDS).build().get();
+        TxnID txnID = transaction.getTxnID();
+        Assert.assertEquals(txnID.getLeastSigBits(), 1);
+        Assert.assertEquals(txnID.getMostSigBits(), 0);

Review comment:
       In fact it should always be 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: commits-unsubscr...@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to