Tejaskriya commented on code in PR #8603:
URL: https://github.com/apache/ozone/pull/8603#discussion_r2218485174
##########
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/ozoneimpl/TestOnDemandContainerScanner.java:
##########
@@ -347,6 +348,16 @@ public void testMerkleTreeWritten() throws Exception {
}
}
+ @Test
+ @Override
+ public void testUnhealthyContainersTriggersVolumeScan() throws Exception {
+ when(controller.markContainerUnhealthy(anyLong(),
any(ScanResult.class))).thenReturn(true);
+ LogCapturer logCapturer =
LogCapturer.captureLogs(OnDemandContainerScanner.class);
+ scanContainer(corruptData);
+ verifyContainerMarkedUnhealthy(corruptData, times(1));
+ assertTrue(logCapturer.getOutput().contains("Triggering scan of volume"));
Review Comment:
The onDemandScan is getting triggered in a different thread at
```
scanExecutor.submit(() -> {
performOnDemandScan(container, helper);
removeContainerFromScheduledContainers(containerId);
});
```
So the mockStatic doesn't work here as it is out of scope. That's why I
checked for the log instead
--
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]