Repository navigation
HDDS-17027. Intermittent failure in TestReplicationSupervisor#testReconciliationTaskMetrics - #11542
Merged
Merged
Conversation
…onciliationTaskMetrics ReplicationSupervisor records task latency with Time.monotonicNow(), which has millisecond resolution. The reconciliation tasks in this test call a Mockito ContainerController that does nothing, so all tasks can complete within the same millisecond, leaving the total latency at 0 and failing the "> 0" assertions. Stub reconcileContainer to sleep 1 ms so each successful task takes at least 1 ms and the total and average latency are always positive. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
1 open finding
What changed in this PR
Stabilizes TestReplicationSupervisor#testReconciliationTaskMetrics by ensuring reconciliation tasks take at least 1ms so latency metrics recorded with millisecond resolution are non-zero.
Changes:
- Stub
ContainerController#reconcileContainerto sleep briefly during the test. - Add an explanatory comment about millisecond-resolution latency metrics.
| File | Description |
|---|---|
| hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/replication/TestReplicationSupervisor.java | Adds a Mockito stub that injects a minimal delay to avoid zero-latency metric readings |
🧠 Review effort: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Copilot stopped reviewing on behalf of
smengcl due to an error
October 14, 2026 22:55
rich7420
approved these changes
Oct 15, 2026
This was referenced Oct 15, 2026
This was referenced Oct 20, 2026
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Generated-by: Claude Code (Opus 5.5)
What changes were proposed in this pull request?
TestReplicationSupervisor#testReconciliationTaskMetricsfails intermittently onassertTrue(getReplicationRequestTotalTime(...) > 0).ReplicationSupervisorrecords task latency withTime.monotonicNow(), which has millisecond resolution. The reconciliation tasks in this test call a MockitoContainerControllerwhosereconcileContainerdoes nothing, so all tasks can complete within the same millisecond and the total latency stays 0.This patch stubs
reconcileContainerin the test to sleep 1 ms, so each successful task takes at least 1 ms and the total and average latency are always positive.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-17027
How was this patch tested?
mvn -pl :hdds-container-service test -Dtest=TestReplicationSupervisor: 54/54 passed locally.monotonicNow()readings around each successful task.🤖 Generated with Claude Code