Skip to content
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

Fix flaky test testGetPropertyNames. #4082

Merged
merged 1 commit into from
Nov 10, 2021

Conversation

yyfMichaelYan
Copy link
Contributor

Fix the flaky test testGetPropertyNames due to the non-deterministic iteration order of HashSet.

This flaky test is found by using Nondex, a tool used to find flaky tests in Java projects. The original assertion on Line#69 may fail because the iteration order of HashSet is non-deterministic, and the elements in the array converted from somePropertyNames may not be the same as the array result. By converting result to a HashSet, the new assertion assertEquals will only check the elements are equal in both sets so that the test will always pass.

@github-actions
Copy link

github-actions bot commented Nov 9, 2021

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@yyfMichaelYan
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@codecov-commenter
Copy link

Codecov Report

Merging #4082 (1189252) into master (0e14333) will decrease coverage by 0.05%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #4082      +/-   ##
============================================
- Coverage     52.45%   52.39%   -0.06%     
+ Complexity     2612     2609       -3     
============================================
  Files           484      484              
  Lines         15203    15203              
  Branches       1572     1572              
============================================
- Hits           7974     7966       -8     
- Misses         6675     6683       +8     
  Partials        554      554              
Impacted Files Coverage Δ
...work/apollo/biz/message/DatabaseMessageSender.java 50.00% <0.00%> (-14.59%) ⬇️
.../apollo/internals/RemoteConfigLongPollService.java 77.71% <0.00%> (-0.61%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0e14333...1189252. Read the comment docs.

Copy link
Member

@nobodyiam nobodyiam left a comment

Choose a reason for hiding this comment

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

Thanks!

@nobodyiam nobodyiam merged commit b00f238 into apolloconfig:master Nov 10, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Nov 10, 2021
@nobodyiam nobodyiam added this to the 2.0.0 milestone Jan 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants