Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Michaelvll committed Nov 21, 2022
1 parent 8985d73 commit c77fe67
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/test_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,21 +868,21 @@ def test_spot_cancellation():
'sleep 5',
f's=$(sky spot queue); printf "$s"; echo; echo; printf "$s" | grep {name} | head -n1 | grep "CANCELLED"',
'sleep 100',
(f'aws ec2 describe-instances --region {region} '
(f's=$(aws ec2 describe-instances --region {region} '
f'--filters Name=tag:ray-cluster-name,Values={name}* '
f'--query Reservations[].Instances[].State[].Name '
'--output text | grep terminated'),
'--output text) && printf "$s" && echo; [[ -z "$s" ]] || [[ "$s" == "terminated" ]]'),
# Test cancelling the spot cluster during spot job being setup.
f'sky spot launch --cloud aws --region {region} -n {name}-2 tests/test_yamls/long_setup.yaml -y -d',
'sleep 300',
f'sky spot cancel -y -n {name}-2',
'sleep 5',
f's=$(sky spot queue); printf "$s"; echo; echo; printf "$s" | grep {name}-2 | head -n1 | grep "CANCELLED"',
'sleep 100',
(f'aws ec2 describe-instances --region {region} '
f'--filters Name=tag:ray-cluster-name,Values={name}* '
(f's=$(aws ec2 describe-instances --region {region} '
f'--filters Name=tag:ray-cluster-name,Values={name}-2* '
f'--query Reservations[].Instances[].State[].Name '
'--output text | grep terminated'),
'--output text) && printf "$s" && echo; [[ -z "$s" ]] || [[ "$s" == "terminated" ]]'),
# Test cancellation during spot job is recovering.
f'sky spot launch --cloud aws --region {region} -n {name}-3 "sleep 1000" -y -d',
'sleep 300',
Expand All @@ -899,10 +899,10 @@ def test_spot_cancellation():
'sleep 10',
f's=$(sky spot queue); printf "$s"; echo; echo; printf "$s" | grep {name}-3 | head -n1 | grep "CANCELLED"',
'sleep 90',
(f'aws ec2 describe-instances --region {region} '
(f's=$(aws ec2 describe-instances --region {region} '
f'--filters Name=tag:ray-cluster-name,Values={name}-3* '
f'--query Reservations[].Instances[].State[].Name '
'--output text | grep terminated'),
'--output text) && printf "$s" && echo; [[ -z "$s" ]] || [[ "$s" == "terminated" ]]'),
])
run_one_test(test)

Expand Down

0 comments on commit c77fe67

Please sign in to comment.