Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -605,25 +605,22 @@ void testGetConfigClusterWideAggregation() {
}

@Test
void testGetClientListClusterWideAggregation() throws InterruptedException {
// Wait for cluster nodes to stabilize client connections
Thread.sleep(3000);

void testGetClientListClusterWideAggregation() {
// Get cluster-wide client list (should combine lists from all primaries)
List<ValkeyClientInfo> clusterClientList = clusterConnection.serverCommands().getClientList();

assertThat(clusterClientList).isNotNull();
assertThat(clusterClientList).isNotEmpty();

// Verify it's actually combining clients from all nodes
int individualClientCounts = 0;
// Verify cluster-wide count is at least the sum from each node
// (>= instead of == to avoid race condition where connections are created between measurements)
int minExpectedClients = 0;
for (ValkeyClusterNode node : allPrimaries) {
List<ValkeyClientInfo> nodeClients = clusterConnection.serverCommands().getClientList(node);
individualClientCounts += nodeClients.size();
minExpectedClients += nodeClients.size();
}

// Cluster-wide list should contain all clients from all nodes
assertThat(clusterClientList.size()).isEqualTo(individualClientCounts);
assertThat(clusterClientList.size()).isGreaterThanOrEqualTo(minExpectedClients);
}

@Test
Expand Down
Loading