rjgoyln opened a new pull request, #11274:
URL: https://github.com/apache/ozone/pull/11274

   ## What changes were proposed in this pull request?
   
   `ReconContainerManager.updateContainerReplica` stamps the first seen and 
last seen time of a new `ContainerReplicaHistory` entry from a single clock 
read. Updating the same replica again refreshes only the last seen time, so the 
test's assertion that it is strictly greater than the first seen time holds 
only once the wall clock has left that millisecond.
   
   What carries it past the boundary today is incidental. The first update is 
the one that flushes the entry to the Recon database, and that write usually 
takes long enough; when it does not, both timestamps are equal and the test 
fails.
   
   * Wait for the clock to leave the first seen millisecond before the second 
update.
   
   The assertion stands as it is, so the test still fails if the last seen time 
stops being refreshed. Bounding the wait by the stamped timestamp rather than a 
fixed sleep keeps it deterministic and normally under a millisecond.
   
   ## What is the link to the Apache JIRA?
   
   https://issues.apache.org/jira/browse/HDDS-16514
   
   ## How was this patch tested?
   
   `TestReconContainerManager` passes with checkstyle clean.
   
   Repeating the failing method 200 times without the fix put the margin the 
assertion depends on at 0 ms on 153 runs, 1 ms on 46 and 3 ms on one, so it 
would have failed on roughly three quarters of them. The same 200 iterations 
pass with the fix and the original assertion in place.
   
   Generated-by: Claude Code (Opus 5)


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