Skip to content
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
36 changes: 16 additions & 20 deletions release/run_release_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,21 @@

set -e

if [ -n "$DEBUG" ]; then
set -x
fi

cd "${0%/*}" || exit 1

reason() {
# Keep in sync with e2e.py ExitCode enum
if [ "$1" -eq 0 ]; then
if [[ "$1" -eq 0 ]]; then
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Debugging Output Feature Unexpectedly Removed

The DEBUG environment variable check and set -x functionality was removed, eliminating the ability to enable verbose shell debugging output. This appears unintentional since the PR only aims to standardize bracket usage, not remove features.

Fix in Cursor Fix in Web

REASON="success"
elif [ "$1" -ge 1 ] && [ "$1" -lt 10 ]; then
elif [[ "$1" -ge 1 && "$1" -lt 10 ]]; then
REASON="runtime error"
elif [ "$1" -ge 10 ] && [ "$1" -lt 20 ]; then
elif [[ "$1" -ge 10 && "$1" -lt 20 ]]; then
REASON="infra error"
elif [ "$1" -ge 30 ] && [ "$1" -lt 40 ]; then
elif [[ "$1" -ge 30 && "$1" -lt 40 ]]; then
REASON="infra timeout"
elif [ "$1" -eq 42 ]; then
elif [[ "$1" -eq 42 ]]; then
REASON="command timeout"
elif [ "$1" -ge 40 ] && [ "$1" -lt 50 ]; then
elif [[ "$1" -ge 40 && "$1" -lt 50 ]]; then
REASON="command error"
fi
echo "${REASON}"
Expand All @@ -35,7 +31,7 @@ BUILDKITE_TIME_LIMIT_FOR_RETRY=10800 # 3 hours

export RAY_TEST_REPO RAY_TEST_BRANCH RELEASE_RESULTS_DIR BUILDKITE_MAX_RETRIES BUILDKITE_RETRY_CODE BUILDKITE_TIME_LIMIT_FOR_RETRY

if [ -n "${RAY_COMMIT_OF_WHEEL-}" ]; then
if [[ -n "${RAY_COMMIT_OF_WHEEL-}" ]]; then
git config --global --add safe.directory /workdir
HEAD_COMMIT=$(git rev-parse HEAD)
echo "The test repo has head commit of ${HEAD_COMMIT}"
Expand All @@ -48,7 +44,7 @@ if [ -n "${RAY_COMMIT_OF_WHEEL-}" ]; then
fi
fi

if [ -z "${NO_INSTALL}" ]; then
if [[ -z "${NO_INSTALL}" ]]; then
# Strip the hashes from the constraint file
# TODO(aslonnie): use bazel run..
grep '==' ./requirements_buildkite.txt > /tmp/requirements_buildkite_nohash.txt
Expand All @@ -60,20 +56,20 @@ fi
RETRY_NUM=0
MAX_RETRIES=${MAX_RETRIES-1}

if [ "${BUILDKITE_RETRY_COUNT-0}" -ge 1 ]; then
if [[ "${BUILDKITE_RETRY_COUNT-0}" -ge 1 ]]; then
echo "This is a manually triggered retry from the Buildkite web UI, so we set the number of infra retries to 1."
MAX_RETRIES=1
fi

ALL_EXIT_CODES=()
while [ "$RETRY_NUM" -lt "$MAX_RETRIES" ]; do
while [[ "$RETRY_NUM" -lt "$MAX_RETRIES" ]]; do
RETRY_NUM=$((RETRY_NUM + 1))

if [ "$RETRY_NUM" -gt 1 ]; then
if [[ "$RETRY_NUM" -gt 1 ]]; then
# Sleep for random time between 30 and 90 minutes
SLEEP_TIME=$((1800 + RANDOM % 5400))

if [ -n "${OVERRIDE_SLEEP_TIME}" ]; then
if [[ -n "${OVERRIDE_SLEEP_TIME}" ]]; then
SLEEP_TIME=${OVERRIDE_SLEEP_TIME}
fi

Expand All @@ -83,7 +79,7 @@ while [ "$RETRY_NUM" -lt "$MAX_RETRIES" ]; do
sleep "${SLEEP_TIME}"
fi

if [ -z "${NO_ARTIFACTS}" ]; then
if [[ -z "${NO_ARTIFACTS}" ]]; then
rm -rf "${RELEASE_RESULTS_DIR:?}"/* || true
fi

Expand Down Expand Up @@ -131,7 +127,7 @@ while [ "$RETRY_NUM" -lt "$MAX_RETRIES" ]; do

done

if [ -z "${NO_ARTIFACTS}" ]; then
if [[ -z "${NO_ARTIFACTS}" ]]; then
rm -rf /tmp/ray_release_test_artifacts/* || true
cp -rf "${RELEASE_RESULTS_DIR}"/* /tmp/ray_release_test_artifacts/ || true
fi
Expand All @@ -152,9 +148,9 @@ echo "----------------------------------------"
REASON=$(reason "${EXIT_CODE}")
echo "Final release test exit code is ${EXIT_CODE} (${REASON}). Took ${RUNTIME}s"

if [ "$EXIT_CODE" -eq 0 ]; then
if [[ "$EXIT_CODE" -eq 0 ]]; then
echo "RELEASE MANAGER: This test seems to have passed."
elif [ "$EXIT_CODE" -ge 30 ] && [ "$EXIT_CODE" -lt 40 ]; then
elif [[ "$EXIT_CODE" -ge 30 && "$EXIT_CODE" -lt 40 ]]; then
echo "RELEASE MANAGER: This is likely an infra error that can be solved by RESTARTING this test."
else
echo "RELEASE MANAGER: This could be an error in the test. Please REVIEW THE LOGS and ping the test owner."
Expand Down