Skip to content

Fixed flaky test in URIUtilsTest#9928

Merged
Jackie-Jiang merged 1 commit intoapache:masterfrom
ycliu28:uri-flaky-test
Dec 8, 2022
Merged

Fixed flaky test in URIUtilsTest#9928
Jackie-Jiang merged 1 commit intoapache:masterfrom
ycliu28:uri-flaky-test

Conversation

@ycliu28
Copy link
Contributor

@ycliu28 ycliu28 commented Dec 7, 2022

bugfix

Context
Fixed the flaky test in 9926. The cause of it is that the test passes a hashmap to URIUtils.buildURI and 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 LinkedHashMap instead of HashMap so the order of the entry will be deterministic in different runs.

@ycliu28 ycliu28 changed the title fixed flaky test in URIUtilsTest Fixed flaky test in URIUtilsTest Dec 7, 2022
@codecov-commenter
Copy link

codecov-commenter commented Dec 7, 2022

Codecov Report

Merging #9928 (e6c928b) into master (b5233dc) will increase coverage by 35.30%.
The diff coverage is n/a.

@@              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     
Flag Coverage Δ
integration1 24.98% <ø> (-0.21%) ⬇️
integration2 24.64% <ø> (+0.11%) ⬆️
unittests1 67.99% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...g/apache/pinot/server/api/resources/ErrorInfo.java 0.00% <0.00%> (-100.00%) ⬇️
...t/server/api/resources/DefaultExceptionMapper.java 0.00% <0.00%> (-75.00%) ⬇️
...ntroller/helix/core/minion/TaskMetricsEmitter.java 34.88% <0.00%> (-51.17%) ⬇️
.../org/apache/pinot/client/PinotClientException.java 33.33% <0.00%> (-33.34%) ⬇️
.../apache/pinot/controller/util/TableSizeReader.java 76.22% <0.00%> (-18.86%) ⬇️
.../controller/helix/core/SegmentDeletionManager.java 30.00% <0.00%> (-18.13%) ⬇️
...troller/helix/core/retention/RetentionManager.java 26.61% <0.00%> (-17.75%) ⬇️
...pinot/controller/util/CompletionServiceHelper.java 72.22% <0.00%> (-16.67%) ⬇️
.../pinot/server/api/resources/TableSizeResource.java 80.00% <0.00%> (-8.00%) ⬇️
...nction/DistinctCountBitmapAggregationFunction.java 49.22% <0.00%> (-7.78%) ⬇️
... and 1128 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants