Skip to content

Commit

Permalink
testing-Pre-compiled end-to-end gpu driver validation
Browse files Browse the repository at this point in the history
Signed-off-by: shiva kumar <[email protected]>
  • Loading branch information
shivakunv committed Sep 2, 2024
1 parent 4a47286 commit 1d8e6cd
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tests/scripts/remote_retry.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

set +e


SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${SCRIPT_DIR}/.definitions.sh
Expand Down Expand Up @@ -39,6 +39,7 @@ source ${SCRIPT_DIR}/.definitions.sh
INTERVAL=30
SECONDS_ELAPSED=0

set +e
# Function to handle timeout exit
handle_timeout() {
echo "SECONDS_ELAPSED $SECONDS_ELAPSED"
Expand All @@ -56,17 +57,20 @@ while [ $SECONDS_ELAPSED -lt $AWS_SYSTEM_ONLINE_CHECK_TIMEOUT ]; do

# Attempt to connect via SSH and ignore errors
# ssh -o ConnectTimeout=4 -i ${private_key} ${instance_hostname} "exit" || status=$?
SSH_EXIT_CODE=0
echo "SHIVA1"
ssh -o ConnectTimeout=5 -i ${private_key} ${instance_hostname} "exit" >/dev/null 2>&1
echo "SHIVA2"
(
ssh -o ConnectTimeout=5 -i ${private_key} ${instance_hostname} "exit"
) >/dev/null 2>&1
SSH_EXIT_CODE=$?

# Check if SSH command succeeded
if [ $? -eq 0 ]; then
if [ $SSH_EXIT_CODE -eq 0 ]; then
echo "Successfully connected to ${instance_hostname}."
trap - EXIT # Disable the timeout trap since the connection was successful
exit 0
fi

echo "SHIVA2"
sleep $INTERVAL
# If SSH fails, wait for the interval before retrying
SECONDS_ELAPSED=$((SECONDS_ELAPSED + INTERVAL))
Expand Down

0 comments on commit 1d8e6cd

Please sign in to comment.