Skip to content

Commit 0a7bdac

Browse files
jparsaiJayendra Parsai
and
Jayendra Parsai
authored
fix: fix race condition in e2e test 1-057_validate_notifications (#817)
Signed-off-by: Jayendra Parsai <[email protected]> Co-authored-by: Jayendra Parsai <[email protected]>
1 parent 3b5b621 commit 0a7bdac

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

test/openshift/e2e/parallel/1-057_validate_notifications/05-verify-email.yaml

+18-10
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,25 @@ kind: TestStep
33
commands:
44
- script: |
55
set -e
6-
sleep 5
76
smtp4dev_pod=$(kubectl get pod -l=app=smtp4dev -o NAME -n $NAMESPACE)
8-
exit_code=$(kubectl -n $NAMESPACE exec --stdin "${smtp4dev_pod}" -- /bin/bash \
9-
-c 'if [[ $(grep -rnw /tmp -e "Subject: Application my-app-3 has been created.") ]]; then
10-
exit 0; else
11-
exit 1;
12-
fi')
137
8+
while :
9+
do
10+
if [[ $timer -eq 120 ]]; then
11+
echo "timed out while waiting for email notification"
12+
exit 1
13+
fi
14+
15+
exit_code=$(kubectl -n $NAMESPACE exec --stdin "${smtp4dev_pod}" -- /bin/bash \
16+
-c 'if [[ $(grep -rnw /tmp -e "Subject: Application my-app-3 has been created.") ]]; then
17+
exit 0; else
18+
exit 1;
19+
fi')
1420
15-
if [[ $exit_code -eq 0 ]]; then
21+
if [[ $exit_code -eq 0 ]]; then
1622
exit 0
17-
else
18-
exit 1
19-
fi
23+
fi
24+
25+
timer=$((timer+5))
26+
sleep 5
27+
done

0 commit comments

Comments
 (0)