This is an automated email from the ASF dual-hosted git repository.
yong pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/branch-3.0 by this push:
new 04c2da4f20f Fix testNoCleanupOffloadLedgerWhenMetadataExceptionHappens
04c2da4f20f is described below
commit 04c2da4f20fa14ecb42671131993bd1e76c98fdd
Author: Jiwe Guo <[email protected]>
AuthorDate: Wed Dec 27 21:56:45 2023 +0800
Fix testNoCleanupOffloadLedgerWhenMetadataExceptionHappens
(cherry picked from commit d276550533115a1030eb46ef69826a8807f191e0)
---
.../test/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerTest.java
b/managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerTest.java
index 663ed1015f4..6c4f21c3af2 100644
---
a/managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerTest.java
+++
b/managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerTest.java
@@ -4210,7 +4210,7 @@ public class ManagedLedgerTest extends
MockedBookKeeperTestCase {
// mock the read handle to make the offload successful
CompletableFuture<ReadHandle> readHandle = new CompletableFuture<>();
readHandle.complete(mock(ReadHandle.class));
-
when(ml.getLedgerHandle(eq(ledgerInfo.getLedgerId()))).thenReturn(readHandle);
+
doReturn(readHandle).when(ml).getLedgerHandle(eq(ledgerInfo.getLedgerId()));
when(ledgerOffloader.offload(any(), any(),
anyMap())).thenReturn(CompletableFuture.completedFuture(null));
ml.ledgers.put(ledgerInfo.getLedgerId(), ledgerInfo);