chihsuan opened a new pull request, #10555: URL: https://github.com/apache/ozone/pull/10555
## What changes were proposed in this pull request? `testSnapshotNameConsistency` verifies that when a snapshot is created with an empty name, all OM nodes converge on the same auto-generated name. The check waited only for *any* snapshot to be present on each OM and then read the lexicographically-last entry from the snapshot table via a prefix iterator. Because the volume/bucket is shared across all test methods (static `@BeforeAll`) and prior tests (including one that restarts the leader OM) leave snapshots behind with uneven replication, different OM nodes could observe different "last" snapshots, producing two distinct names and the intermittent `expected: <1> but was: <2>` failure. The fix mirrors the sibling `testSnapshotIdConsistency`: it captures the generated name returned by `createSnapshot` and waits on each OM for that exact snapshot key, instead of scanning for the last entry. This removes the dependency on cross-test leftovers and replication ordering. The `@Flaky` tag and the now-unused imports are removed. This is a test-only change; OM behavior is unchanged (the name is generated once on the leader in `preExecute` and replicated, so all OMs already converge on the same name). ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-15222 ## How was this patch tested? - Reproduced the exact failure deterministically: injecting an uneven leftover snapshot on a single OM (sorting after the auto-generated `s<date>` name) on the unmodified test yields `AssertionFailedError: expected: <1> but was: <2>`, matching the report. - With the same injection applied to the fixed test, it passes, confirming the race window is closed rather than merely not opening. - Clean run of `TestOzoneManagerHASnapshot#testSnapshotNameConsistency` passes; `checkstyle.sh` passes. Generated-by: Claude Code (Claude Opus 4.8) -- 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]
