Skip to content

HDDS-14197. Add utility for generating unique object name in tests#9517

Merged
adoroszlai merged 1 commit intoapache:masterfrom
adoroszlai:HDDS-14197
Dec 19, 2025
Merged

HDDS-14197. Add utility for generating unique object name in tests#9517
adoroszlai merged 1 commit intoapache:masterfrom
adoroszlai:HDDS-14197

Conversation

@adoroszlai
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Provide a method that tests can use to generate unique names for objects (volumes, buckets, keys, etc.).

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

How was this patch tested?

CI:
https://github.com/adoroszlai/ozone/actions/runs/20300605053

Copy link
Copy Markdown
Contributor

@devmadhuu devmadhuu left a comment

Choose a reason for hiding this comment

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

Thanks @adoroszlai for the patch. This is good change and generic. So are we planning to change and use this across all test code in ozone wherever we are creating volumes, buckets etc ?

@rich7420
Copy link
Copy Markdown
Contributor

@adoroszlai thanks for the patch !

private String getBucketName(String suffix) {
return ("v1-" + getTestName() + "bucket" + suffix).toLowerCase(Locale.ROOT);
private String getBucketName(String ignored) {
return uniqueObjectName();
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.

Should we have "v1-" / "v2-" prefixes still ?

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.

Actually, I don't really know about the difference between v1 and v2.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

v1/v2 prefix was added in HDDS-14191 only to make the names unique across the two tests.

private String getBucketName(String suffix) {
return ("v2-" + getTestName() + "bucket" + suffix).toLowerCase(Locale.ROOT);
private String getBucketName(String ignored) {
return uniqueObjectName();
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.

and here

@sarvekshayr
Copy link
Copy Markdown
Contributor

So are we planning to change and use this across all test code in ozone wherever we are creating volumes, buckets etc ?

+1 to this question.

@adoroszlai
Copy link
Copy Markdown
Contributor Author

So are we planning to change and use this across all test code in ozone wherever we are creating volumes, buckets etc ?

+1 to this question.

I don't plan to update all test code just for this. But whenever we add new or change existing tests, this can be used to simplify a bit.

@adoroszlai adoroszlai merged commit cfc0449 into apache:master Dec 19, 2025
29 checks passed
@adoroszlai adoroszlai deleted the HDDS-14197 branch December 19, 2025 09:28
@adoroszlai
Copy link
Copy Markdown
Contributor Author

Thanks @devmadhuu, @rich7420, @sarvekshayr for the review.

@rich7420
Copy link
Copy Markdown
Contributor

thanks @adoroszlai !

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants