Skip to content

Commit 7d560ea

Browse files
AritraDey-Devdhawtoncraigbox
authored
remove use of istioctl x wait (#16515)
* fix(tests): remove use of deprecated 'istioctl experimental wait' * Update tests/util/helpers.sh Co-authored-by: Daniel Hawton <[email protected]> * feat: log duration when _wait_for_istio times out * fix: lint target * Update test not to look for resources that are not created * modify wait_for _istio to wait_for_resource * Revert "modify wait_for _istio to wait_for_resource" This reverts commit c10ec0c. * check the tests * fix function name * fix function name * change function name _wait_for_istio to _wait_for_resource * revert: fucntion name to _wait_for_istio * renamed fucntion name in archive * renamed fucntion name in tests dir * modified helpers.sh * fix: lint target * add a sleep of 2s * refractor: sleep for 2s * wait for all the pods to be ready * refractor: sleep for 2s * modified helpers.sh * change exit to return * refarctor: not returning 1 Signed-off-by: Aritra Dey <[email protected]> * fix: returning 1 Signed-off-by: Aritra Dey <[email protected]> * revert: duration log Signed-off-by: Aritra Dey <[email protected]> * fix: lint target Signed-off-by: Aritra Dey <[email protected]> --------- Signed-off-by: Aritra Dey <[email protected]> Co-authored-by: Daniel Hawton <[email protected]> Co-authored-by: Craig Box <[email protected]>
1 parent f5a9d07 commit 7d560ea

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

content/en/docs/tasks/traffic-management/request-timeouts/test.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,8 @@ else
4343
snip_request_timeouts_3
4444

4545
# wait for rules to propagate
46-
_wait_for_istio virtualservice default productpage
4746
_wait_for_istio virtualservice default reviews
4847
_wait_for_istio virtualservice default ratings
49-
_wait_for_istio virtualservice default details
5048
fi
5149

5250
get_productpage() {

tests/util/helpers.sh

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -105,22 +105,20 @@ _wait_for_statefulset() {
105105
fi
106106
}
107107

108-
# Wait for Istio config to propagate
108+
# Wait for resource to be created
109109
# usage: _wait_for_istio <kind> <namespace> <name>
110110
_wait_for_istio() {
111-
#local kind="$1"
112-
#local namespace="$2"
113-
#local name="$3"
114-
local start=$(date +%s)
115-
sleep 1s
116-
# @TODO: Rewrite this to *NOT* use istioctl experimental wait, since it was removed
117-
# https://github.com/istio/istio.io/issues/16429
118-
#if ! istioctl experimental wait --for=distribution --timeout=10s "$kind" "$name.$namespace"; then
119-
#echo "Failed distribution of $kind $name in namespace $namespace"
120-
#istioctl ps
121-
#echo "TEST: wait for failed, but continuing."
122-
#fi
123-
echo "Duration: $(($(date +%s)-start)) seconds"
111+
local kind="$1"
112+
local namespace="$2"
113+
local name="$3"
114+
local start_time=$(date +%s)
115+
if ! kubectl wait --for=create -n "$namespace" "$kind/$name" --timeout 30s; then
116+
local end_time=$(date +%s)
117+
echo "Timed out waiting for $kind $name in namespace $namespace to be created."
118+
echo "Duration: $(( end_time - start_time )) seconds"
119+
return 1
120+
fi
121+
sleep 2s
124122
}
125123

126124
# Wait for named Gateway API gateway to be ready

0 commit comments

Comments
 (0)