avijayanhwx commented on a change in pull request #233: HDDS-1873 Add API to 
get last completed times for every Recon task.
URL: https://github.com/apache/hadoop-ozone/pull/233#discussion_r348271024
 
 

 ##########
 File path: 
hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/tasks/TestReconTaskControllerImpl.java
 ##########
 @@ -88,17 +88,29 @@ public void testConsumeOMEvents() throws Exception {
     when(omUpdateEventBatchMock.isEmpty()).thenReturn(false);
     when(omUpdateEventBatchMock.filter(Collections.singleton("MockTable")))
         .thenReturn(omUpdateEventBatchMock);
+
+    long startTime = System.currentTimeMillis();
     reconTaskController.consumeOMEvents(
         omUpdateEventBatchMock,
         mock(OMMetadataManager.class));
 
     verify(reconDBUpdateTaskMock, times(1))
         .process(any());
+    long endTime = System.currentTimeMillis();
+
+    ReconTaskStatusDao dao = new ReconTaskStatusDao(sqlConfiguration);
+    ReconTaskStatus reconTaskStatus = dao.findById("MockTask");
+    long taskTimeStamp = reconTaskStatus.getLastUpdatedTimestamp();
+
+    Assert.assertTrue(startTime <= taskTimeStamp
 
 Review comment:
   Can we add sequence number test here just like you have added in 
testReInitializeTasks()?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to