Skip to content

Commit

Permalink
shellcheck: Simplify exit code checks
Browse files Browse the repository at this point in the history
Simplify a pattern where the exit code was checked by examining the
value of `$?`. In these cases, this can be simplified by checking the
result of the command directly.

    SC2181 (style): Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.

Signed-off-by: Russell Bryant <[email protected]>
  • Loading branch information
russellb committed Aug 27, 2024
1 parent 1a75a70 commit cee03e3
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ run_serving_tests() {
bash -c "$server_command" &

# wait until the server is alive
wait_for_server
if [ $? -eq 0 ]; then
if wait_for_server; then
echo ""
echo "lmdeploy server is up and running."
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,7 @@ run_serving_tests() {
server_pid=$!

# wait until the server is alive
wait_for_server
if [ $? -eq 0 ]; then
if wait_for_server; then
echo ""
echo "vllm server is up and running."
else
Expand Down
3 changes: 1 addition & 2 deletions .buildkite/nightly-benchmarks/scripts/run-tgi-nightly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ run_serving_tests() {
eval "$server_command" &

# wait until the server is alive
wait_for_server
if [ $? -eq 0 ]; then
if wait_for_server; then
echo ""
echo "tgi server is up and running."
else
Expand Down
3 changes: 1 addition & 2 deletions .buildkite/nightly-benchmarks/scripts/run-trt-nightly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ run_serving_tests() {
bash ../.buildkite/nightly-benchmarks/scripts/launch-trt-server.sh "$server_params" "$common_params"

# wait until the server is alive
wait_for_server
if [ $? -eq 0 ]; then
if wait_for_server; then
echo ""
echo "trt server is up and running."
else
Expand Down
3 changes: 1 addition & 2 deletions .buildkite/nightly-benchmarks/scripts/run-vllm-nightly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ run_serving_tests() {
eval "$server_command" &

# wait until the server is alive
wait_for_server
if [ $? -eq 0 ]; then
if wait_for_server; then
echo ""
echo "vllm server is up and running."
else
Expand Down

0 comments on commit cee03e3

Please sign in to comment.