smengcl opened a new pull request, #11482: URL: https://github.com/apache/ozone/pull/11482
Generated-by: Claude Code (Opus 5.5) ## What changes were proposed in this pull request? `TestSCMNodeManager#testDatanodeFinalizedCounterExcludesNonHealthyNodes` fails intermittently for the DEAD parameter: ``` IN_SERVICE(no expiry)-DEAD node should be excluded from total count ==> expected: <1> but was: <0> ``` The test sets the stale node interval to 3s and drives node state with fixed `Thread.sleep` calls. In the DEAD case the last heartbeat of the baseline node is followed by `Thread.sleep(3000)`, so that heartbeat is at least 3s old when the assertions run. If the node health check (100ms period) fires between the end of the sleep and the assertions, the baseline node itself is marked STALE and the healthy datanode count is 0 instead of 1. This PR replaces the fixed sleeps with `GenericTestUtils.waitFor` that keeps heartbeating the baseline node until the other node reaches the expected state, the same pattern other tests in this class already use. The baseline heartbeat is then at most about 100ms old at assertion time, far below the 3s stale node interval. Test only change. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-16934 ## How was this patch tested? - Confirmed the cause: with a temporary 150ms sleep added before the assertions, the DEAD case failed every time with the baseline node reported as `IN_SERVICE-STALE`. - With the fix, 15 consecutive local runs passed: `mvn -pl :hdds-server-scm test -Dtest='TestSCMNodeManager#testDatanodeFinalizedCounterExcludesNonHealthyNodes' -DskipShade -DskipRecon -DskipDocs` - 10x10 [flaky-test-check](https://github.com/smengcl/hadoop-ozone/actions/runs/38207483296) on this branch: in progress 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
