You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by GitBox <gi...@apache.org> on 2022/10/08 03:54:09 UTC

[GitHub] [shenyu] BoyuLi4 opened a new pull request, #4043: Fixed Possible Json Ordering Permutations Problem in Tests

BoyuLi4 opened a new pull request, #4043:
URL: https://github.com/apache/shenyu/pull/4043

   ## **Fixed Possible Json Ordering Permutations Problem in Tests**
   - [x] You have read the [contribution guidelines](https://shenyu.apache.org/community/contributor-guide).
   - [ ] You submit test cases (unit or integration tests) that back your changes.
   - [x] Your local test passed `./mvnw clean install -Dmaven.javadoc.skip=true`.
   
   The same fix things with more tests like PR https://github.com/apache/shenyu/pull/4040
   <!-- Describe your PR here; eg. Fixes #issueNo -->
   ## What is the purpose of the change
   The 
   ```
   org.apache.shenyu.admin.service.register#
   ShenyuClientRegisterDivideServiceImplTest.testBuildHandle
   ShenyuClientRegisterDubboServiceImplTest.testBuildHandle
   ShenyuClientRegisterGrpcServiceImplTest.testBuildHandle
   ShenyuClientRegisterTarsServiceImplTest.testBuildHandle 
   ShenyuClientRegisterSofaServiceImplTest.testRuleHandler
   ShenyuClientRegisterSpringCloudServiceImplTest..testBuildHandle
   ```
   
   has flakiness.
   
   The test flakiness is due to comparisons between Json Strings and outputs from` JsonUtils.toJson()` and `GsonUtils.getInstance().toJson()`. 
   However, JsonObject does not guarantee entry orders, its object is an unordered set of name/value pairs, and internal permutations may occur in the output from toJson().
   
   There are five more similar tests that also have these kinds of flakiness. This is just an example, I will change the other five if you accept these changes.
   ## Brief changelog
   
   Since the JSON tool used in the Project is GSON, so I use the GSON library `JsonParser `to convert the string back to JSON Object and compare them.  
   
   ## Verifying this change
   
   This test avoids nested or different orders of JSON strings that cause flaky errors.
   Since I didn't touch any Source code, it should be no impact on the project.
   And it passed the local test that the guidelines mentioned.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shenyu] codecov-commenter commented on pull request #4043: Fixed Possible Json Ordering Permutations Problem in Tests

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #4043:
URL: https://github.com/apache/shenyu/pull/4043#issuecomment-1272243362

   # [Codecov](https://codecov.io/gh/apache/shenyu/pull/4043?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#4043](https://codecov.io/gh/apache/shenyu/pull/4043?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5855c84) into [master](https://codecov.io/gh/apache/shenyu/commit/1cd41f5cfece4b8a6c9b8c8954bba8bb1bfc336e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (1cd41f5) will **decrease** coverage by `0.26%`.
   > The diff coverage is `n/a`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #4043      +/-   ##
   ============================================
   - Coverage     70.11%   69.85%   -0.27%     
   + Complexity     6748     6712      -36     
   ============================================
     Files           935      935              
     Lines         25408    25400       -8     
     Branches       2288     2285       -3     
   ============================================
   - Hits          17816    17742      -74     
   - Misses         6202     6263      +61     
   - Partials       1390     1395       +5     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shenyu/pull/4043?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ache/shenyu/plugin/grpc/cache/GrpcClientCache.java](https://codecov.io/gh/apache/shenyu/pull/4043/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLWdycGMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoZW55dS9wbHVnaW4vZ3JwYy9jYWNoZS9HcnBjQ2xpZW50Q2FjaGUuamF2YQ==) | `68.75% <0.00%> (-31.25%)` | :arrow_down: |
   | [.../client/server/consul/ShenyuConsulConfigWatch.java](https://codecov.io/gh/apache/shenyu/pull/4043/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LXJlZ2lzdGVyLWNlbnRlci9zaGVueXUtcmVnaXN0ZXItY2xpZW50LXNlcnZlci9zaGVueXUtcmVnaXN0ZXItY2xpZW50LXNlcnZlci1jb25zdWwvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoZW55dS9yZWdpc3Rlci9jbGllbnQvc2VydmVyL2NvbnN1bC9TaGVueXVDb25zdWxDb25maWdXYXRjaC5qYXZh) | `60.41% <0.00%> (-25.00%)` | :arrow_down: |
   | [...a/org/apache/shenyu/common/utils/VersionUtils.java](https://codecov.io/gh/apache/shenyu/pull/4043/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LWNvbW1vbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hlbnl1L2NvbW1vbi91dGlscy9WZXJzaW9uVXRpbHMuamF2YQ==) | `67.85% <0.00%> (-10.72%)` | :arrow_down: |
   | [...va/org/apache/shenyu/plugin/cache/CachePlugin.java](https://codecov.io/gh/apache/shenyu/pull/4043/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLWNhY2hlL3NoZW55dS1wbHVnaW4tY2FjaGUtaGFuZGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hlbnl1L3BsdWdpbi9jYWNoZS9DYWNoZVBsdWdpbi5qYXZh) | `85.29% <0.00%> (-8.83%)` | :arrow_down: |
   | [.../apache/shenyu/admin/model/dto/BatchCommonDTO.java](https://codecov.io/gh/apache/shenyu/pull/4043/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LWFkbWluL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvYWRtaW4vbW9kZWwvZHRvL0JhdGNoQ29tbW9uRFRPLmphdmE=) | `50.00% <0.00%> (-7.15%)` | :arrow_down: |
   | [...apache/shenyu/admin/model/dto/AuthPathWarpDTO.java](https://codecov.io/gh/apache/shenyu/pull/4043/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LWFkbWluL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvYWRtaW4vbW9kZWwvZHRvL0F1dGhQYXRoV2FycERUTy5qYXZh) | `57.14% <0.00%> (-7.15%)` | :arrow_down: |
   | [...org/apache/shenyu/admin/model/dto/AuthPathDTO.java](https://codecov.io/gh/apache/shenyu/pull/4043/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LWFkbWluL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvYWRtaW4vbW9kZWwvZHRvL0F1dGhQYXRoRFRPLmphdmE=) | `58.82% <0.00%> (-5.89%)` | :arrow_down: |
   | [...henyu/plugin/grpc/resolver/ShenyuNameResolver.java](https://codecov.io/gh/apache/shenyu/pull/4043/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLWdycGMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoZW55dS9wbHVnaW4vZ3JwYy9yZXNvbHZlci9TaGVueXVOYW1lUmVzb2x2ZXIuamF2YQ==) | `58.51% <0.00%> (-5.32%)` | :arrow_down: |
   | [...elimiter/handler/RateLimiterPluginDataHandler.java](https://codecov.io/gh/apache/shenyu/pull/4043/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLXJhdGVsaW1pdGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvcGx1Z2luL3JhdGVsaW1pdGVyL2hhbmRsZXIvUmF0ZUxpbWl0ZXJQbHVnaW5EYXRhSGFuZGxlci5qYXZh) | `54.54% <0.00%> (-4.55%)` | :arrow_down: |
   | [...che/shenyu/admin/model/vo/DashboardUserEditVO.java](https://codecov.io/gh/apache/shenyu/pull/4043/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LWFkbWluL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvYWRtaW4vbW9kZWwvdm8vRGFzaGJvYXJkVXNlckVkaXRWTy5qYXZh) | `60.86% <0.00%> (-4.35%)` | :arrow_down: |
   | ... and [35 more](https://codecov.io/gh/apache/shenyu/pull/4043/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shenyu] yu199195 merged pull request #4043: Fixed Possible Json Ordering Permutations Problem in Tests

Posted by GitBox <gi...@apache.org>.
yu199195 merged PR #4043:
URL: https://github.com/apache/shenyu/pull/4043


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org