chihsuan opened a new pull request, #10659:
URL: https://github.com/apache/ozone/pull/10659
## What changes were proposed in this pull request?
Test-only change.
**Problem.** `testMetrics` intermittently fails with `Expecting actual: 0L
to be greater than: 0L` at
`assertThat(metrics.getDataSizeMovedGB()).isGreaterThan(0)`. The test mocks the
first container move to fail (`REPLICATION_FAIL_NODE_UNHEALTHY`) and subsequent
moves to succeed. Since HDDS-10699 parameterized the test over cluster sizes
4-30, the smallest clusters can occasionally produce a random layout where only
one move is schedulable. `REPLICATION_FAIL_NODE_UNHEALTHY` does not put the
source datanode back into the candidate queue, so that single move is the
mocked failure, no move completes, and the metric is legitimately 0. CI
failures consistently show parameter `[1]` (the 4-node cluster).
**Fix.** Replace the assertion with an invariant that holds for any layout:
`dataSizeMovedGB >= numContainerMovesCompleted`. Every container in
`TestableCluster` is a whole number of GB (1-5 GB), so each completed move
contributes at least 1 GB; when nothing completes, `0 >= 0` holds. The
assertion still catches a regression where the metric stops accumulating,
because it fails whenever any move completes without increasing the metric.
Also removes the `@Flaky("HDDS-11093")` annotation.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-11093
## How was this patch tested?
- Reproduced the exact reported failure deterministically on the unchanged
test by mocking all moves to fail, confirming the failure occurs iff no move
completes.
- Re-injected the same all-moves-fail fault on the fixed test: the changed
assertion no longer fires (the run then fails only at `assertEquals(1,
getNumContainerMovesFailed())`, which is the direct consequence of the injected
mock, not the race).
- flaky-test-check on the fork, `testMetrics` 10x10 = 100 runs, all green:
https://github.com/chihsuan/ozone/actions/runs/28692288330
- flaky-test-check on the fork, whole class 10x10 = 100 runs: `testMetrics`
failed 0 times. The run shows failures only in unrelated siblings:
`checkIterationResultException` (known flaky, HDDS-11855) and
`balancerShouldOnlySelectConfiguredIncludeContainers` (newly reported as
HDDS-15737): https://github.com/chihsuan/ozone/actions/runs/28691674922
Generated-by: Claude Code (Fable 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]