Skip to content

Commit

Permalink
[2606] Fixed Non-deterministic behavior of HashSet that might fail th…
Browse files Browse the repository at this point in the history
…e test ClientLibrariesImplTest (#2621)

* Fixed flaky test
* Changed HashSet to LinkedHashSet in ClientLibrariesImpl
* Removed unused import HashSet
  • Loading branch information
SaaiVenkat committed Dec 27, 2023
1 parent ca953b4 commit 321de65
Showing 1 changed file with 1 addition and 2 deletions.
Expand Up @@ -22,7 +22,6 @@
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -297,7 +296,7 @@ private String getInline(LibraryType libraryType) {
@NotNull
protected Set<String> getCategoriesFromComponents() {
try (ResourceResolver resourceResolver = resolverFactory.getServiceResourceResolver(Collections.singletonMap(ResourceResolverFactory.SUBSERVICE, COMPONENTS_SERVICE))) {
Set<String> categories = new HashSet<>();
Set<String> categories = new LinkedHashSet<>();
for (ClientLibrary library : this.getAllClientLibraries(resourceResolver)) {
for (String category : library.getCategories()) {
if (pattern == null || pattern.matcher(category).matches()) {
Expand Down

0 comments on commit 321de65

Please sign in to comment.