Skip to content

Conversation

@adoroszlai
Copy link
Contributor

@adoroszlai adoroszlai commented Dec 10, 2020

What changes were proposed in this pull request?

TestDefaultCertificateClient passes "UTF-8" to RandomStringUtils.random(int, String) with the intention to use UTF-8 encoding. It was added in HDDS-1087 to fix CI failures.

However, the parameter is not for character encoding, rather:

     * @param chars  the String containing the set of characters to use,
     *  may be null, but must not be empty

So this results in values like: "--8F8T8U8T...".

This PR proposes another fix:

  1. Allow random() to generate strings using all characters.
  2. Fix test failure by specifying UTF-8 encoding when calling String.getBytes().

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

How was this patch tested?

Reproduced HDDS-1087 by removing chars argument:
https://github.com/adoroszlai/hadoop-ozone/runs/1530939654#step:3:3638

Verified the new fix:
https://github.com/adoroszlai/hadoop-ozone/runs/1530664863#step:3:3779

@adoroszlai adoroszlai self-assigned this Dec 10, 2020
@adoroszlai adoroszlai requested a review from xiaoyuyao December 10, 2020 15:16
@xiaoyuyao
Copy link
Contributor

LGTM, +1.

@xiaoyuyao xiaoyuyao merged commit dfd2aaf into apache:master Dec 14, 2020
@adoroszlai adoroszlai deleted the HDDS-4576 branch December 15, 2020 05:33
@adoroszlai
Copy link
Contributor Author

Thanks @xiaoyuyao for reviewing and committing it.

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.

2 participants