chihsuan commented on code in PR #10452:
URL: https://github.com/apache/ozone/pull/10452#discussion_r3368465827


##########
hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/tasks/TestReconTaskControllerImpl.java:
##########
@@ -236,9 +246,17 @@ public void testFailedTaskRetryLogic() throws Exception {
     reconTaskController.consumeOMEvents(omUpdateEventBatchMock,
         mock(OMMetadataManager.class));
     
-    // Wait for async processing to complete
-    Thread.sleep(3000); // Increase timeout for retry logic
-    
+    GenericTestUtils.waitFor(() -> {
+      try {
+        ReconTaskStatus status = reconTaskStatusDao.findById(taskName);
+        return status != null
+            && status.getLastTaskRunStatus() == 0
+            && status.getLastUpdatedSeqNumber() == 100L;
+      } catch (Exception e) {
+        return false;
+      }
+    }, 100, 5000);

Review Comment:
   nit: This `waitFor` block is duplicated verbatim in `testConsumeOMEvents` 
and `testFailedTaskRetryLogic`. We can consider extracting a small helper.
   
   Not a blocker, happy to merge as is.



-- 
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