congbobo184 commented on code in PR #15592:
URL: https://github.com/apache/pulsar/pull/15592#discussion_r874307171
##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/pendingack/PendingAckPersistentTest.java:
##########
@@ -437,24 +438,32 @@ public void testPendingAckLowWaterMarkRemoveFirstTxn()
throws Exception {
.get();
PersistentSubscription persistentSubscription =
persistentTopic.getSubscription(subName);
+ Field field1 =
PersistentSubscription.class.getDeclaredField("pendingAckHandle");
+ field1.setAccessible(true);
+ PendingAckHandleImpl oldPendingAckHandle = (PendingAckHandleImpl)
field1.get(persistentSubscription);
+ Field field2 =
PendingAckHandleImpl.class.getDeclaredField("individualAckOfTransaction");
+ field2.setAccessible(true);
+ LinkedMap<TxnID, HashMap<PositionImpl, PositionImpl>>
oldIndividualAckOfTransaction =
+ (LinkedMap<TxnID, HashMap<PositionImpl, PositionImpl>>)
field2.get(oldPendingAckHandle);
+ Awaitility.await().untilAsserted(() ->
Assert.assertEquals(oldIndividualAckOfTransaction.size(), 0));
+
PendingAckHandleImpl pendingAckHandle = new
PendingAckHandleImpl(persistentSubscription);
Method method =
PendingAckHandleImpl.class.getDeclaredMethod("initPendingAckStore");
method.setAccessible(true);
method.invoke(pendingAckHandle);
- Field field1 =
PendingAckHandleImpl.class.getDeclaredField("pendingAckStoreFuture");
- field1.setAccessible(true);
+ Field field3 =
PendingAckHandleImpl.class.getDeclaredField("pendingAckStoreFuture");
+ field3.setAccessible(true);
CompletableFuture<PendingAckStore> completableFuture =
- (CompletableFuture<PendingAckStore>)
field1.get(pendingAckHandle);
+ (CompletableFuture<PendingAckStore>)
field3.get(pendingAckHandle);
Awaitility.await().until(() -> {
completableFuture.get();
return true;
});
- Field field2 =
PendingAckHandleImpl.class.getDeclaredField("individualAckOfTransaction");
- field2.setAccessible(true);
+
Review Comment:
this should check individualAckOfTransaction which recovered
--
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]