Skip to content

Commit

Permalink
fix jobs queue smoke test
Browse files Browse the repository at this point in the history
  • Loading branch information
Michaelvll committed Nov 26, 2024
1 parent 10c5f21 commit 1b3c277
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/test_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -3539,10 +3539,12 @@ def test_managed_jobs_inline_env(generic_cloud: str):
[
f'sky jobs launch -n {name} -y --cloud {generic_cloud} --env TEST_ENV="hello world" -- "echo "\\$TEST_ENV"; ([[ ! -z \\"\$TEST_ENV\\" ]] && [[ ! -z \\"\${constants.SKYPILOT_NODE_IPS}\\" ]] && [[ ! -z \\"\${constants.SKYPILOT_NODE_RANK}\\" ]] && [[ ! -z \\"\${constants.SKYPILOT_NUM_NODES}\\" ]]) || exit 1"',
'sleep 20',
f'{_GET_JOB_QUEUE} | grep {name} | grep SUCCEEDED',
f'JOB_ID=$(sky jobs queue -n {name} | grep {name} | head -n1 | awk \'{{print $1}}\') && '
f'JOB_ROW=$(sky jobs queue | grep {name} | head -n1) && '
f'echo "$JOB_ROW" && echo "$JOB_ROW" | grep "SUCCEEDED" && '
f'JOB_ID=$(echo "$JOB_ROW" | awk \'{{print $1}}\') && '
f'echo "JOB_ID=$JOB_ID" && '
# Test that logs are still available after the job finishes.
's=$(sky jobs logs $JOB_ID) && echo "$s" && echo "$s" | grep "hello world" && '
'unset SKYPILOT_DEBUG; s=$(sky jobs logs $JOB_ID --refresh) && echo "$s" && echo "$s" | grep "hello world" && '
# Make sure we skip the unnecessary logs.
'echo "$s" | head -n1 | grep "Waiting for"',
],
Expand Down

0 comments on commit 1b3c277

Please sign in to comment.