chihsuan opened a new pull request, #10667: URL: https://github.com/apache/ozone/pull/10667
## What changes were proposed in this pull request? Test-only change. **Problem.** `TestContainerBalancerDatanodeNodeLimit#checkIterationResultException` failed intermittently (12/100 in CI) with `Expecting actual: 0L to be greater than or equal to: 3L`. The assertion `getNumContainerMovesFailed() >= 3` (or `>= 1` for small clusters) is not an invariant: `TestableCluster` builds each cluster with an unseeded `ThreadLocalRandom`, and how many container moves get scheduled depends on that random replica layout. On unlucky layouts fewer than the expected number of moves are scheduled, so the hardcoded count cannot hold. The randomness was introduced intentionally in HDDS-4929 to fuzz replica distribution while node utilizations stay deterministically unbalanced; the move count is an emergent side effect this test should never have asserted a fixed number on. **Fix.** Assert invariants that hold for any layout instead of a magic number. Every move is mocked to fail, so none can be counted as completed (`numContainerMovesCompletedInLatestIteration == 0`); and if any move was actually scheduled, every attempt must be accounted as a failure or a timeout rather than silently dropped. The `@Flaky` marker is removed. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-11855 ## How was this patch tested? - Ran the fixed method and the full `TestContainerBalancerDatanodeNodeLimit` class locally: 336 tests, 0 failures. - `checkstyle.sh` clean for `hdds-server-scm`. - Ran the `flaky-test-check` workflow on the fork for the whole class (`test-name=ALL`, 10×10 = 100 runs, Java 21): all green. https://github.com/chihsuan/ozone/actions/runs/28726374356 -- 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]
