Skip to content

Commit a632cc1

Browse files
authored
fix flaky test com.ctrip.framework.apollo.configservice.service.AppNamespaceServiceWithCacheTest#testAppNamespace (#4998)
1 parent 5e49df6 commit a632cc1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/service/AppNamespaceServiceWithCache.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import java.util.concurrent.Executors;
4545
import java.util.concurrent.ScheduledExecutorService;
4646
import java.util.concurrent.TimeUnit;
47+
import java.util.stream.Collectors;
4748

4849
/**
4950
* @author Jason Song([email protected])
@@ -194,7 +195,7 @@ private void mergeAppNamespaces(List<AppNamespace> appNamespaces) {
194195

195196
//for those updated or deleted app namespaces
196197
private void updateAndDeleteCache() {
197-
List<Long> ids = Lists.newArrayList(appNamespaceIdCache.keySet());
198+
List<Long> ids = appNamespaceIdCache.keySet().stream().sorted().collect(Collectors.toList());
198199
if (CollectionUtils.isEmpty(ids)) {
199200
return;
200201
}

0 commit comments

Comments
 (0)