Skip to content

HDDS-16223. Remove racy pre-condition assertion in TestRefreshVolumeUsageHandler - #11063

Merged
chungen0126 merged 1 commit into
apache:masterfrom
rich7420:HDDS-16223
Aug 23, 2026
Merged

HDDS-16223. Remove racy pre-condition assertion in TestRefreshVolumeUsageHandler#11063
chungen0126 merged 1 commit into
apache:masterfrom
rich7420:HDDS-16223

Conversation

@rich7420

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

The test sets HDDS_NODE_REPORT_INTERVAL to 1s, so the datanode node report can reach SCM between key.close() and the assertion that SCM still shows the pre-write used space, making assertTrue(...getScmUsed().isEqual(baseline)) intermittently fail (expected true but was false). That pre-condition asserts a transient not-yet-propagated state and adds no coverage; the intended behavior (SCM eventually reflects the increased used space) is already verified by the following waitFor and assertTrue(...isGreater(baseline)). Remove the racy assertion.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-16223

How was this patch tested?

https://github.com/rich7420/ozone/actions/runs/32255956955/

https://github.com/rich7420/ozone/actions/runs/32255725038

…sageHandler

The test sets HDDS_NODE_REPORT_INTERVAL to 1s, so the datanode node report can
reach SCM between key.close() and the assertion that SCM still shows the
pre-write used space, making assertTrue(...getScmUsed().isEqual(baseline))
intermittently fail (expected true but was false). That pre-condition asserts a
transient not-yet-propagated state and adds no coverage; the intended behavior
(SCM eventually reflects the increased used space) is already verified by the
following waitFor and assertTrue(...isGreater(baseline)). Remove the racy
assertion.
Copilot AI lite review requested due to automatic review settings August 19, 2026 13:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chihsuan chihsuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for patch! @rich7420 LGTM +1.

For other reviewers: I dug into the history and found that HDDS-6577 made the datanode update its cached usage on write but left this isEqual behind, so it has only been asserting that no node report has arrived yet, which HDDS_NODE_REPORT_INTERVAL=1s does not guarantee.

@chungen0126
chungen0126 merged commit d8940a9 into apache:master Aug 23, 2026
29 of 30 checks passed
@rich7420

Copy link
Copy Markdown
Contributor Author

@chihsuan and @chungen0126 thanks for the review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants