eolivelli commented on a change in pull request #10366:
URL: https://github.com/apache/pulsar/pull/10366#discussion_r620937689



##########
File path: 
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/TransactionMetadataStoreServiceTest.java
##########
@@ -181,6 +181,36 @@ public void testTimeoutTracker() throws Exception {
                 .until(() -> txnMap.size() == 0);
     }
 
+    @Test
+    public void testTimeoutTrackerExpired() throws Exception {
+        
pulsar.getTransactionMetadataStoreService().addTransactionMetadataStore(TransactionCoordinatorID.get(0));
+        Awaitility.await().atMost(2000, TimeUnit.MILLISECONDS)
+                .until(() -> pulsar.getTransactionMetadataStoreService()
+                        .getStores().get(TransactionCoordinatorID.get(0)) != 
null);
+        MLTransactionMetadataStore transactionMetadataStore =
+                (MLTransactionMetadataStore) 
pulsar.getTransactionMetadataStoreService()
+                        .getStores().get(TransactionCoordinatorID.get(0));
+        checkTransactionMetadataStoreReady(transactionMetadataStore);
+        Field field = 
MLTransactionMetadataStore.class.getDeclaredField("txnMetaMap");
+        field.setAccessible(true);
+        ConcurrentMap<TxnID, Pair<TxnMeta, List<Position>>> txnMap =
+                (ConcurrentMap<TxnID, Pair<TxnMeta, List<Position>>>) 
field.get(transactionMetadataStore);
+

Review comment:
       I meant to use Whitebox.getInternalState that is a useful utility in 
order to not using directly reflection, that it is something that breaks from 
one JDK version to the next one.
   
   not a problem for me, just a suggestion




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to