Skip to content

Commit

Permalink
[WFCORE-6214] Fixed 2 Flaky Tests in cli
Browse files Browse the repository at this point in the history
  • Loading branch information
RishabhPrabhu5 committed Feb 11, 2023
1 parent b0401ff commit ee2aace
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.IdentityHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.ResourceBundle;
import java.util.Set;
import java.util.TreeSet;
import org.aesh.command.activator.OptionActivator;
import org.aesh.command.impl.internal.ProcessedOption;
import org.wildfly.core.cli.command.aesh.activator.DependOptionActivator;
Expand Down Expand Up @@ -181,7 +183,8 @@ private String addSynopsisOption(SynopsisOption currentOption) {
synopsisBuilder.append(" |");
// Keep the set of all conflicts, they will be removed from all conflicts, being handled at this level.
Set<SynopsisOption> conflicts = new HashSet<>(currentOption.conflictWith);
Set<SynopsisOption> conflicts2 = new HashSet<>(currentOption.conflictWith);
Set<SynopsisOption> conflicts2 = new TreeSet<>(Comparator.comparing(SynopsisOption::getName));
conflicts2.addAll(currentOption.conflictWith);
// Conflicts can have dependencies that must be added prior to them
for (SynopsisOption so : conflicts2) {
Set<SynopsisOption> conflictAndDependencies = retrieveAllDependencies(so);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.CancellationException;
Expand Down Expand Up @@ -214,7 +215,7 @@ public void test() throws Exception {
Set<String> operations = new HashSet<>();
operations.add("op1");
operations.add("op2");
Set<String> echos = new HashSet<>();
Set<String> echos = new LinkedHashSet<>();
echos.add("echo TestWarning > ${" + propWarning + "}");
echos.add("echo TestError > ${" + propError + "}");
echos.add("echo TestFoo >> ${" + propFoo + "}");
Expand Down

0 comments on commit ee2aace

Please sign in to comment.