Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
058f590
fix(tests): remove use of deprecated 'istioctl experimental wait'
AritraDey-Dev May 23, 2025
d2dbd15
Update tests/util/helpers.sh
AritraDey-Dev May 23, 2025
957c7ff
feat: log duration when _wait_for_istio times out
AritraDey-Dev May 23, 2025
57cd5c5
fix: lint target
AritraDey-Dev May 24, 2025
df990b2
Update test not to look for resources that are not created
craigbox May 27, 2025
c10ec0c
modify wait_for _istio to wait_for_resource
AritraDey-Dev May 27, 2025
7a23cad
Revert "modify wait_for _istio to wait_for_resource"
AritraDey-Dev May 27, 2025
c120182
check the tests
AritraDey-Dev May 27, 2025
ce680ee
fix function name
AritraDey-Dev May 27, 2025
4f8341b
fix function name
AritraDey-Dev May 27, 2025
8484c9a
change function name _wait_for_istio to _wait_for_resource
AritraDey-Dev May 27, 2025
7fd3f4b
revert: fucntion name to _wait_for_istio
AritraDey-Dev May 28, 2025
c9abfa8
renamed fucntion name in archive
AritraDey-Dev May 28, 2025
3538a9c
renamed fucntion name in tests dir
AritraDey-Dev May 28, 2025
838397c
modified helpers.sh
AritraDey-Dev May 29, 2025
a6c7f89
fix: lint target
AritraDey-Dev May 29, 2025
0cd3471
add a sleep of 2s
AritraDey-Dev May 30, 2025
d5edbd0
refractor: sleep for 2s
AritraDey-Dev Jun 1, 2025
71487b5
wait for all the pods to be ready
AritraDey-Dev Jun 1, 2025
6d29b4a
refractor: sleep for 2s
AritraDey-Dev Jun 1, 2025
9b6b1b6
modified helpers.sh
AritraDey-Dev Jun 1, 2025
caff24d
change exit to return
AritraDey-Dev Jun 2, 2025
171c7f9
refarctor: not returning 1
AritraDey-Dev Jun 7, 2025
278ff9e
fix: returning 1
AritraDey-Dev Jun 7, 2025
7bd8949
revert: duration log
AritraDey-Dev Jun 10, 2025
d2146d4
fix: lint target
AritraDey-Dev Jun 10, 2025
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 @@ -43,10 +43,8 @@ else
snip_request_timeouts_3

# wait for rules to propagate
_wait_for_istio virtualservice default productpage
_wait_for_istio virtualservice default reviews
_wait_for_istio virtualservice default ratings
_wait_for_istio virtualservice default details
fi

get_productpage() {
Expand Down
26 changes: 12 additions & 14 deletions tests/util/helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,22 +105,20 @@ _wait_for_statefulset() {
fi
}

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use exit 1 like in other functions?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using return 1 not causing tests to fail
While exit 1 causing the tests to immediate failure.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An important thing to note here is that previously it did not use exit 1. Adding exit 1 now might cause the test to fail because it immediately terminates the entire script when a resource isn't created, while the previous behavior (without exit 1) allowed the test to continue running even if the resource creation failed, potentially masking underlying issues.

fi
sleep 2s
}

# Wait for named Gateway API gateway to be ready
Expand Down