From ef6841ea1600ac0d0f33f5e675882d8f8c0ecb3b Mon Sep 17 00:00:00 2001 From: Ben Napolitan Date: Sat, 13 Jun 2020 21:35:21 -0400 Subject: [PATCH] Fix grep causing failure. --- scripts/lib/common.sh | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/scripts/lib/common.sh b/scripts/lib/common.sh index 8d9f5c707d..04ab4eec96 100644 --- a/scripts/lib/common.sh +++ b/scripts/lib/common.sh @@ -37,28 +37,21 @@ function run_scale_test_130_pods() { ITERATION_START=$SECONDS $KUBECTL_PATH scale -f deploy-130-pods.yaml --replicas=130 sleep 20 - GET_DEPLOY_OUTPUT="" - while [[ ${#GET_DEPLOY_OUTPUT} -lt 1 && $((SECONDS - ITERATION_START)) -lt 200 ]] + while [[ ! $($KUBECTL_PATH get deploy | grep 130/130) && $((SECONDS - ITERATION_START)) -lt 200 ]] do sleep 1 echo "Scaling UP" echo $($KUBECTL_PATH get deploy) - GET_DEPLOY_OUTPUT=$($KUBECTL_PATH get deploy | grep 130/130) - echo "Made it past grep get deploy. Printing grep length and seconds taken" - echo ${#GET_DEPLOY_OUTPUT} - echo $((SECONDS - ITERATION_START)) done SCALE_UP_DURATION_ARRAY+=( $((SECONDS - ITERATION_START)) ) MIDPOINT_START=$SECONDS $KUBECTL_PATH scale -f deploy-130-pods.yaml --replicas=0 - GET_DELETE_OUTPUT="TEMPSTRING" - while [[ ${#GET_DELETE_OUTPUT} -gt 1 && $((SECONDS - MIDPOINT_START)) -lt 200 ]] + while [[ $($KUBECTL_PATH get pods) && $((SECONDS - MIDPOINT_START)) -lt 200 ]] do sleep 1 echo "Scaling DOWN" echo $($KUBECTL_PATH get deploy) - GET_DELETE_OUTPUT=$($KUBECTL_PATH get pods) done SCALE_DOWN_DURATION_ARRAY+=($((SECONDS - MIDPOINT_START))) done