Skip to content

Commit eca0fc4

Browse files
committed
refactor(e2e): use deploy.Spec.Replicas directly as source of truth
Remove intermediate expectedServerCount variable and use int(*deploy.Spec.Replicas) directly for clarity. Signed-off-by: jimyag <[email protected]>
1 parent 1c4bbb3 commit eca0fc4

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

test/e2e/ha/ha_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ func getDbSidsFromClusterStatus(f *framework.Framework, deploy *appsv1.Deploymen
133133
framework.ExpectNoError(err)
134134
framework.ExpectHaveLen(pods.Items, int(*deploy.Spec.Replicas))
135135

136-
expectedServerCount := len(pods.Items)
137136
dbServers := make(map[string]map[string]string)
138137

139138
// Wait for cluster to converge with retry logic
@@ -161,9 +160,9 @@ func getDbSidsFromClusterStatus(f *framework.Framework, deploy *appsv1.Deploymen
161160
status := parseClusterStatus(stdout)
162161

163162
// Check if cluster has converged (all servers are visible)
164-
if len(status.Servers) != expectedServerCount {
163+
if len(status.Servers) != int(*deploy.Spec.Replicas) {
165164
framework.Logf("Cluster %s not converged yet in pod %s: expected %d servers, got %d, will retry",
166-
db, pod.Name, expectedServerCount, len(status.Servers))
165+
db, pod.Name, int(*deploy.Spec.Replicas), len(status.Servers))
167166
return false, nil // Retry until cluster converges
168167
}
169168

0 commit comments

Comments
 (0)