Skip to content

Commit

Permalink
Resolve flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
MyEnthusiastic committed Nov 29, 2023
1 parent f5fb6d1 commit ec8128a
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
import java.io.Closeable;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Properties;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
Expand Down Expand Up @@ -149,7 +152,12 @@ public void processResult(CuratorFramework client, CuratorEvent event) throws Ex
@VisibleForTesting
public static String configToConnectionString(QuorumVerifier data) throws Exception {
StringBuilder sb = new StringBuilder();
for (QuorumPeer.QuorumServer server : data.getAllMembers().values()) {

List<QuorumPeer.QuorumServer> servers =
new ArrayList<>(data.getAllMembers().values());
Collections.sort(servers, (a, b) -> a.toString().compareTo(b.toString()));

for (QuorumPeer.QuorumServer server : servers) {
if (server.clientAddr == null) {
// Invalid client address configuration in zoo.cfg
continue;
Expand Down

0 comments on commit ec8128a

Please sign in to comment.