Closed wang3820 closed 10 months ago
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅
I have read the CLA Document and I hereby sign the CLA
recheck
Merging #5007 (1f795cb) into master (bc55ba6) will increase coverage by
0.34%
. Report is 1 commits behind head on master. The diff coverage is91.66%
.
@@ Coverage Diff @@
## master #5007 +/- ##
============================================
+ Coverage 49.27% 49.61% +0.34%
- Complexity 1889 1908 +19
============================================
Files 372 372
Lines 11538 11553 +15
Branches 1123 1127 +4
============================================
+ Hits 5685 5732 +47
+ Misses 5513 5479 -34
- Partials 340 342 +2
Files | Coverage Δ | |
---|---|---|
...mework/apollo/biz/service/AppNamespaceService.java | 32.46% <ø> (ø) |
|
...gservice/service/AppNamespaceServiceWithCache.java | 81.61% <100.00%> (ø) |
|
...p/framework/apollo/portal/api/AdminServiceAPI.java | 13.19% <ø> (ø) |
|
.../apollo/portal/controller/AccessKeyController.java | 22.22% <ø> (ø) |
|
...mework/apollo/portal/controller/AppController.java | 29.33% <ø> (ø) |
|
...rk/apollo/portal/controller/ClusterController.java | 36.36% <ø> (ø) |
|
...o/portal/controller/NamespaceBranchController.java | 18.91% <ø> (ø) |
|
.../apollo/portal/controller/NamespaceController.java | 11.95% <ø> (ø) |
|
...apollo/portal/controller/PermissionController.java | 5.75% <ø> (ø) |
|
...ollo/portal/controller/ServerConfigController.java | 85.71% <ø> (ø) |
|
... and 6 more |
There was a similar pr #4998 merged, does the issue this pr try to solve still exist?
There was a similar pr #4998 merged, does the issue this pr try to solve still exist?
This PR appears to be reduntant as #4998 fixes the same issue. Closing this PR.
What's the purpose of this PR
To fix flaky testing at
com.ctrip.framework.apollo.configservice.service.AppNamespaceServiceWithCacheTest#testAppNamespace
Which issue(s) this PR fixes:
com.ctrip.framework.apollo.configservice.service.AppNamespaceServiceWithCacheTest#testAppNamespace
is flaky. Nondex was used to check and locate the flakiness in the test. The test can be reproduced using the following command:Brief changelog
Implementation of
appNamespaceIdCache
was changed from https://github.com/wang3820/apollo/blob/5e49df687c64cf6f64f0210ba3ebc13084468757/apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/service/AppNamespaceServiceWithCache.java#L87 to https://github.com/wang3820/apollo/blob/66b66a972552733339d154504c785907d30c5249/apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/service/AppNamespaceServiceWithCache.java#L72Maps.newConcurrentMap()
returns aConcurrentHashMap
object and its order is not maintained. WhenkeySet()
is called, this results in returning a null object.The nondex debug log:
Follow this checklist to help us incorporate your contribution quickly and easily:
mvn clean test
to make sure this pull request doesn't break anything.CHANGES
log.