Fixed flaky test in URIUtilsTest#9928
Merged
Jackie-Jiang merged 1 commit intoapache:masterfrom Dec 8, 2022
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #9928 +/- ##
=============================================
+ Coverage 28.12% 63.42% +35.30%
- Complexity 53 4840 +4787
=============================================
Files 1970 1970
Lines 106081 106081
Branches 16089 16089
=============================================
+ Hits 29833 67287 +37454
+ Misses 73330 33837 -39493
- Partials 2918 4957 +2039
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Jackie-Jiang
approved these changes
Dec 8, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bugfixContext
Fixed the flaky test in 9926. The cause of it is that the test passes a hashmap to
URIUtils.buildURIand in that function, it uses a for loop to iterate through the map entry and concatenate the parameters into the URI string. However, the order of the the map entry in a hashmap is non-deterministic, so different URI string could be formed even with the same hashmap.Fix
In the test, use
LinkedHashMapinstead ofHashMapso the order of the entry will be deterministic in different runs.