Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix intermittent failures of E2E tests 1-045 and 1-069 #824

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
@@ -1,11 +1,29 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: sleep 10
- script: |
timeout=$(oc get -n $NAMESPACE deployment argocd-repo-server -o json \
| jq -r '.spec.template.spec.containers[0].env[]|select(.name=="ARGOCD_EXEC_TIMEOUT").value')
if test "$timeout" != "300s"; then
echo "Assertion failed. Timeout should be 300s, is '$timeout'"
- script: |
function check_timeout() {
timeout=$(oc get -n $NAMESPACE deployment argocd-repo-server -o json \
| jq -r '.spec.template.spec.containers[0].env[]|select(.name=="ARGOCD_EXEC_TIMEOUT").value')
if test "$timeout" != "300s"; then
echo "Waiting for timeout to be 300s, is '$timeout'"
return 1
fi
return 0
}

echo -n "Waiting until timeout has expected value"
for i in {1..150}; do # timeout after 5 minutes

if check_timeout; then
# success
echo ".spec.template.spec.containers[0].env had expected env var"
exit 0
else
echo "Still waiting for 'spec.template.spec.containers[0].env' to have expected env var"
fi
sleep 2
done

echo ".spec.template.spec.containers[0].env never had expected env var"
exit 1
fi
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,37 @@ apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: |
set -e
secret_type="$(oc get secrets argocd-operator-redis-tls -n $NAMESPACE --template '{{.type}}')"
secret_len="$(oc get secrets argocd-operator-redis-tls -n $NAMESPACE --template '{{len .data}}')"
expected_secret_type="kubernetes.io/tls"
expected_secret_len=2
function check_secret() {
secret_type="$(oc get secrets argocd-operator-redis-tls -n $NAMESPACE --template '{{.type}}')"
secret_len="$(oc get secrets argocd-operator-redis-tls -n $NAMESPACE --template '{{len .data}}')"
expected_secret_type="kubernetes.io/tls"
expected_secret_len=2

if test ${secret_type} != ${expected_secret_type}; then
echo "argocd-operator-redis-tls secret type is ${secret_type} and should be ${expected_secret_type}"
exit 1
fi
if test ${secret_len} != ${expected_secret_len}; then
echo "argocd-operator-redis-tls secret length is ${secret_len} and should be ${expected_secret_len}"
exit 1
fi
if test ${secret_type} != ${expected_secret_type}; then
echo "argocd-operator-redis-tls secret type is ${secret_type} and should be ${expected_secret_type}"
return 1
fi
if test ${secret_len} != ${expected_secret_len}; then
echo "argocd-operator-redis-tls secret length is ${secret_len} and should be ${expected_secret_len}"
return 1
fi

return 0
}

echo -n "Waiting until secret has expected type and .data length"
for i in {1..150}; do # timeout after 5 minutes

if check_secret; then
# success
echo "Secret has expected length and type."
exit 0
else
echo "Still waiting for Secret to have expected length and type."
fi
sleep 2
done

echo "Secret never had expected length and type"
exit 1

Loading