Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
codelipenghui committed Mar 31, 2022
1 parent 8b13d3d commit b9f1b79
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -164,15 +164,15 @@ public void testTransactionBufferClientTimeout() throws Exception {
CompletableFuture<TxnID> endFuture =
transactionBufferHandler.endTxnOnTopic("test", 1, 1, TxnAction.ABORT, 1);

Field field = TransactionBufferHandlerImpl.class.getDeclaredField("pendingRequests");
Field field = TransactionBufferHandlerImpl.class.getDeclaredField("outstandingRequests");
field.setAccessible(true);
ConcurrentSkipListMap<Long, Object> pendingRequests =
ConcurrentSkipListMap<Long, Object> outstandingRequests =
(ConcurrentSkipListMap<Long, Object>) field.get(transactionBufferHandler);

assertEquals(pendingRequests.size(), 1);
assertEquals(outstandingRequests.size(), 1);

Awaitility.await().atLeast(2, TimeUnit.SECONDS).until(() -> {
if (pendingRequests.size() == 0) {
if (outstandingRequests.size() == 0) {
return true;
}
return false;
Expand Down

0 comments on commit b9f1b79

Please sign in to comment.