-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Update TestMultiValidationTokeFile token generation with no trailing newline char #9943
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update TestMultiValidationTokeFile token generation with no trailing newline char #9943
Conversation
…newline char Description The test does the following: 1.Randomly appends new-line character to the token value buffer 2. If #1 is done, it generates temp token file with buffer containing new-line character. 3. Also, it remember the original token for future validation 4. The code parse and read token-validation files and removes the new-line character as desired. Failure in this case due to random buffer used to populate token value contained newline character which was used for validation, however, the file parse/read code as expected removed the newline character, hence causing the mismatch. Patch addresses the concern by ensuring test generated random token-value has no trailing newline chars. Testing tests/fast/RandomUnitTests.toml -s 1355028229
Doxense CI Report for Windows 10
|
Result of foundationdb-pr-clang-ide on Linux CentOS 7
|
Result of foundationdb-pr-macos-m1 on macOS Ventura 13.x
|
Result of foundationdb-pr-macos on macOS Ventura 13.x
|
Result of foundationdb-pr on Linux CentOS 7
|
Result of foundationdb-pr-clang on Linux CentOS 7
|
Result of foundationdb-pr-cluster-tests on Linux CentOS 7
|
| loop { | ||
| deterministicRandom()->randomBytes(mutateString(buff), tokenLen); | ||
| token = std::string((char*)buff.begin(), tokenLen); | ||
| removeTrailingChar(token, '\n'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the token allowed to have a trailing newline that is part of the token? If so, is there any risk introduced by us not testing that case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No newline character aren't allowed.
Description
The test does the following:
1.Randomly appends new-line character to the token value buffer
2. If #1 is done, it generates temp token file with buffer containing new-line character.
3. Also, it remember the original token for future validation
4. The code parse and read token-validation files and removes the new-line character as desired.
Failure in this case due to random buffer used to populate token value contained newline character which was used for validation, however, the file parse/read code as expected removed the newline character, hence causing the mismatch.
Patch addresses the concern by ensuring test generated random token-value has no trailing newline chars.
Testing
tests/fast/RandomUnitTests.toml -s 1355028229
Code-Reviewer Section
The general pull request guidelines can be found here.
Please check each of the following things and check all boxes before accepting a PR.
For Release-Branches
If this PR is made against a release-branch, please also check the following:
release-branchormainif this is the youngest branch)