jojochuang commented on code in PR #9335:
URL: https://github.com/apache/ozone/pull/9335#discussion_r2566524487


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMDbCheckpointServletInodeBasedXfer.java:
##########
@@ -767,27 +771,33 @@ public void 
testCheckpointIncludesSnapshotsFromFrozenState() throws Exception {
         .filter(snap -> snap.getName().equals("snapshot1"))
         .findFirst()
         .orElseThrow(() -> new RuntimeException("snapshot1 not found"));
-
     // Setup servlet mocks for checkpoint processing
     setupMocks();
     
when(requestMock.getParameter(OZONE_DB_CHECKPOINT_INCLUDE_SNAPSHOT_DATA)).thenReturn("true");
 
     // Create a checkpoint that captures current state (S1)
-    DBStore dbStore = om.getMetadataManager().getStore();
-    DBStore spyDbStore = spy(dbStore);
-    AtomicReference<DBCheckpoint> capturedCheckpoint = new AtomicReference<>();
+    DBStore spyDbStore = spy(om.getMetadataManager().getStore());
 
-    when(spyDbStore.getCheckpoint(true)).thenAnswer(invocation -> {
-      // Purge snapshot2 before checkpoint
+    AtomicReference<DBCheckpoint> capturedCheckpoint = new AtomicReference<>();
+    SnapshotCache spySnapshotCache = 
spy(om.getOmSnapshotManager().getSnapshotCache());
+    OmSnapshotManager spySnapshotManager = spy(om.getOmSnapshotManager());
+    when(om.getOmSnapshotManager()).thenReturn(spySnapshotManager);
+    when(spySnapshotManager.getSnapshotCache()).thenReturn(spySnapshotCache);
+    // Mock the snapshot cache to create a snapshot2 just after taking a 
snapshot cache lock.
+    doAnswer(invocationOnMock -> {
+      Object ret = invocationOnMock.callRealMethod();
       // create snapshot 3 before checkpoint

Review Comment:
   This comment no longer applies
   ```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.

To unsubscribe, e-mail: [email protected]

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to