Copilot commented on code in PR #11542:
URL: https://github.com/apache/ozone/pull/11542#discussion_r4276965560
##########
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/replication/TestReplicationSupervisor.java:
##########
@@ -524,6 +524,12 @@ public void
testReconciliationTaskMetrics(ContainerLayoutVersion layout) throws
ReplicationSupervisorMetrics replicationMetrics =
ReplicationSupervisorMetrics.create(replicationSupervisor);
+ // The latency metric has millisecond resolution, so make each successful
reconciliation take at least 1 ms.
+ doAnswer(invocation -> {
+ Thread.sleep(1);
Review Comment:
`Thread.sleep(1)` can still be flaky on some platforms due to
scheduler/timer granularity and may return early if interrupted; it also clears
the interrupt status. Consider (mandatory) restoring the interrupt flag when
interrupted, and (recommended) increasing the sleep duration (eg, 2–5ms) or
using an uninterruptible sleep helper to make the test more deterministic
across environments.
--
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]