Skip to content

Commit e5ee98b

Browse files
committed
fix rebalance sqs test to check for eviction
1 parent 4c8f718 commit e5ee98b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/e2e/rebalance-recommendation-sqs-test

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ GET_ATTRS_SQS_CMD="awslocal sqs get-queue-attributes --queue-url ${queue_url} --
153153

154154
cordoned=0
155155
tainted=0
156-
not_evicted=0
156+
evicted=0
157157
message_deleted=0
158158
test_node="${TEST_NODE:-$CLUSTER_NAME-worker}"
159159
for i in $(seq 1 $TAINT_CHECK_CYCLES); do
@@ -167,9 +167,9 @@ for i in $(seq 1 $TAINT_CHECK_CYCLES); do
167167
tainted=1
168168
fi
169169

170-
if [[ $cordoned -eq 1 && $(kubectl get deployments regular-pod-test -o=jsonpath='{.status.unavailableReplicas}') -eq 0 ]]; then
171-
echo "✅ Verified the regular-pod-test pod was NOT evicted!"
172-
not_evicted=1
170+
if [[ $cordoned -eq 1 && $(kubectl get deployments regular-pod-test -o=jsonpath='{.status.unavailableReplicas}') -eq 1 ]]; then
171+
echo "✅ Verified the regular-pod-test pod was evicted!"
172+
evicted=1
173173
fi
174174

175175
if [[ ${tainted} -eq 1 && $(kubectl exec -i "${localstack_pod}" -- bash -c "${GET_ATTRS_SQS_CMD}" | jq '(.Attributes.ApproximateNumberOfMessagesNotVisible|tonumber) + (.Attributes.ApproximateNumberOfMessages|tonumber)' ) -eq 0 ]]; then
@@ -189,8 +189,8 @@ if [[ $cordoned -eq 0 ]]; then
189189
elif [[ $tainted -eq 0 ]]; then
190190
echo "❌ Worker node was not tainted"
191191
fail_and_exit 3
192-
elif [[ $not_evicted -eq 0 ]]; then
193-
echo "❌ regular-pod-test was evicted"
192+
elif [[ $evicted -eq 0 ]]; then
193+
echo "❌ regular-pod-test was NOT evicted"
194194
fail_and_exit 3
195195
elif [[ $message_deleted -eq 0 ]]; then
196196
echo "❌ message was not removed from the queue after processing"

0 commit comments

Comments
 (0)