-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix intermittent failures of E2E tests 1-045 and 1-069
Signed-off-by: Jonathan West <jonwest@redhat.com>
- Loading branch information
Showing
2 changed files
with
59 additions
and
20 deletions.
There are no files selected for viewing
32 changes: 25 additions & 7 deletions
32
test/openshift/e2e/parallel/1-045_validate_repo_exec_timeout/04-check-workload-env.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
func 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters