Skip to content

Commit

Permalink
retry success/failure curls
Browse files Browse the repository at this point in the history
  • Loading branch information
laverya committed Aug 10, 2024
1 parent d32388d commit 4901f16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tgrun/pkg/runner/vmi/embed/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function send_logs()

function report_status_update()
{
curl -X PUT -f -H "Content-Type: application/json" -d "{\"status\": \"$1\"}" "$TESTGRID_APIENDPOINT/v1/instance/$NODE_ID/node-status"
retry 5 curl -X PUT -f -H "Content-Type: application/json" -d "{\"status\": \"$1\"}" "$TESTGRID_APIENDPOINT/v1/instance/$NODE_ID/node-status"
}

function get_initprimary_status()
Expand Down
6 changes: 3 additions & 3 deletions tgrun/pkg/runner/vmi/embed/runcmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -482,15 +482,15 @@ function report_success() {
local failure="$1"

if [ -n "$failure" ]; then
curl -X POST -d "{\"success\": true, \"failureReason\": \"${failure}\"}" "$TESTGRID_APIENDPOINT/v1/instance/$TEST_ID/finish"
retry 5 curl -X POST -d "{\"success\": true, \"failureReason\": \"${failure}\"}" "$TESTGRID_APIENDPOINT/v1/instance/$TEST_ID/finish"
else
curl -X POST -d '{"success": true}' "$TESTGRID_APIENDPOINT/v1/instance/$TEST_ID/finish"
retry 5 curl -X POST -d '{"success": true}' "$TESTGRID_APIENDPOINT/v1/instance/$TEST_ID/finish"
fi
}

function report_failure() {
local failure="$1"
curl -X POST -d "{\"success\": false, \"failureReason\": \"${failure}\"}" "$TESTGRID_APIENDPOINT/v1/instance/$TEST_ID/finish"
retry 5 curl -X POST -d "{\"success\": false, \"failureReason\": \"${failure}\"}" "$TESTGRID_APIENDPOINT/v1/instance/$TEST_ID/finish"
}

function wait_for_cluster_ready() {
Expand Down

0 comments on commit 4901f16

Please sign in to comment.