Skip to content

[th/dpu-operator-handle-errors] improve error handling in "dpu-operator-e2e-tests-workflow-tests-commands.sh" script #65391

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

Merged
Merged
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
Expand Up @@ -90,10 +90,10 @@ if [ -z "$queue_manager_tls_ip" ] ; then
exit 1
fi

submit_response="$(_curl_jobs_submit "$PULL_NUMBER" "$PULL_PULL_SHA")"
submit_response="$(_curl_jobs_submit "$PULL_NUMBER" "$PULL_PULL_SHA")" || die "Failure submitting job in queue-manager"

return_code="$(_json_get "$submit_response" '.return_code')"
if [ "$return_code" -ne 200 ] && [ "$return_code" -ne 202 ] ; then
if [ "$return_code" -ne 200 ] 2>/dev/null && [ "$return_code" -ne 202 ] 2>/dev/null ; then
echo "failure to start job: $return_code"
exit 1
fi
Expand All @@ -103,19 +103,19 @@ uuid="$(_json_get "$submit_response" '.message')"
echo "Started job in queue manager: UUID=$uuid, return_code=$return_code. Start polling"

while true ; do
retrieve_response="$(_curl_jobs_retrieve "$uuid")"
retrieve_response="$(_curl_jobs_retrieve "$uuid")" || die "Failure checking job status in queue-manager"

return_code="$(_json_get "$retrieve_response" '.return_code')"

if [ "$return_code" -eq 102 ] ; then
if [ "$return_code" -eq 102 ] 2>/dev/null ; then
# Job still running.
sleep 15
continue
fi

result_msg="$(_json_get "$retrieve_response" '.result_msg')"

if [ "$return_code" -ne 200 ] ; then
if [ "$return_code" -ne 200 ] 2>/dev/null ; then
echo "failure checking for job $uuid [$return_code]: $result_msg"
exit 1
fi
Expand Down