Skip to content

Commit

Permalink
fix: fix race condition in e2e test 1-057_validate_notifications (#817)
Browse files Browse the repository at this point in the history
Signed-off-by: Jayendra Parsai <[email protected]>
Co-authored-by: Jayendra Parsai <[email protected]>
  • Loading branch information
jparsai and Jayendra Parsai authored Dec 5, 2024
1 parent 3b5b621 commit 0a7bdac
Showing 1 changed file with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,25 @@ kind: TestStep
commands:
- script: |
set -e
sleep 5
smtp4dev_pod=$(kubectl get pod -l=app=smtp4dev -o NAME -n $NAMESPACE)
exit_code=$(kubectl -n $NAMESPACE exec --stdin "${smtp4dev_pod}" -- /bin/bash \
-c 'if [[ $(grep -rnw /tmp -e "Subject: Application my-app-3 has been created.") ]]; then
exit 0; else
exit 1;
fi')
while :
do
if [[ $timer -eq 120 ]]; then
echo "timed out while waiting for email notification"
exit 1
fi
exit_code=$(kubectl -n $NAMESPACE exec --stdin "${smtp4dev_pod}" -- /bin/bash \
-c 'if [[ $(grep -rnw /tmp -e "Subject: Application my-app-3 has been created.") ]]; then
exit 0; else
exit 1;
fi')
if [[ $exit_code -eq 0 ]]; then
if [[ $exit_code -eq 0 ]]; then
exit 0
else
exit 1
fi
fi
timer=$((timer+5))
sleep 5
done

0 comments on commit 0a7bdac

Please sign in to comment.