Skip to content

Commit

Permalink
Fix app-con test timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
VOID404 committed Sep 25, 2023
1 parent 88fa123 commit 6cafb5c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/components/application-connector/scripts/check-pod-logs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,21 @@ if [ $# -ne 1 ]; then
fi


time_so_far=0 # we've already waited that many seconds
sleep_sec=5 # wait between checks
wait_timeout=900 # 15min -> 900sec
retval_complete=1
retval_failed=1
while [[ $retval_complete -ne 0 ]] && [[ $retval_failed -ne 0 ]]; do
sleep 5
while [[ $retval_complete -ne 0 ]] && [[ $retval_failed -ne 0 ]] && [[ $time_so_far -le $wait_timeout ]]; do
sleep $sleep_sec
time_so_far=$((time_so_far+sleep_sec))

output=$(kubectl wait --for=condition=failed -n $NAMESPACE job/$JOB_NAME --timeout=0 2>&1)
retval_failed=$?
output=$(kubectl wait --for=condition=complete -n $NAMESPACE job/$JOB_NAME --timeout=0 2>&1)
retval_complete=$?
done


if ([[ ${EXPORT_RESULT} == true ]]); then
kubectl -n $NAMESPACE logs -f job/$JOB_NAME | tee /dev/stderr | $GOPATH/bin/go-junit-report -subtest-mode exclude-parents -set-exit-code > junit-report.xml
else
Expand Down

0 comments on commit 6cafb5c

Please sign in to comment.