Skip to content

Commit

Permalink
fix smoke test
Browse files Browse the repository at this point in the history
  • Loading branch information
Michaelvll committed Apr 3, 2024
1 parent 6b0ed01 commit 0e89159
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion sky/serve/autoscalers.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def __init__(self, service_name: str,
# Target number of replicas is initialized to min replicas
self.target_num_replicas: int = spec.min_replicas
self.latest_version: int = constants.INITIAL_VERSION
self.latest_version_ever_ready: int = self.latest_version
self.latest_version_ever_ready: int = self.latest_version - 1
self.update_mode = serve_utils.DEFAULT_UPDATE_MODE

def update_version(self, version: int, spec: 'service_spec.SkyServiceSpec',
Expand Down
14 changes: 7 additions & 7 deletions tests/test_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -3269,16 +3269,16 @@ def test_skyserve_user_bug_restart(generic_cloud: str):
[
f'sky serve up -n {name} --cloud {generic_cloud} -y tests/skyserve/restart/user_bug.yaml',
f's=$(sky serve status {name}); echo "$s";'
'until echo "$s" | grep -A2 "Service Replicas" | grep "SHUTTING_DOWN"; '
'until echo "$s" | grep -A 100"Service Replicas" | grep "SHUTTING_DOWN"; '
'do echo "Waiting for first service to be SHUTTING DOWN..."; '
f'sleep 5; s=$(sky serve status {name}); echo "$s"; done; ',
f's=$(sky serve status {name}); echo "$s";'
'until echo "$s" | grep -A2 "Service Replicas" | grep "FAILED"; '
'until echo "$s" | grep -A 100"Service Replicas" | grep "FAILED"; '
'do echo "Waiting for first service to be FAILED..."; '
f'sleep 5; s=$(sky serve status {name}); echo "$s"; done; echo "$s"; '
+ _check_replica_in_status(name, [(1, True, 'FAILED')]) +
# User bug failure will cause no further scaling.
f'echo "$s" | grep -A4 "Service Replicas" | grep "{name}" | wc -l | grep 1; '
f'echo "$s" | grep -A 100"Service Replicas" | grep "{name}" | wc -l | grep 1; '
f'echo "$s" | grep -B100 "NO_REPLICA" | grep "0/1"',
f'sky serve update {name} --cloud {generic_cloud} -y tests/skyserve/auto_restart.yaml',
f'{_SERVE_ENDPOINT_WAIT.format(name=name)}; '
Expand Down Expand Up @@ -3595,17 +3595,17 @@ def test_skyserve_failures(generic_cloud: str):
[
f'sky serve up -n {name} --cloud {generic_cloud} -y tests/skyserve/failures/initial_delay.yaml',
f's=$(sky serve status {name}); '
f'until ! echo "$s" | grep "FAILED_INITIAL_DELAY"; do '
f'until echo "$s" | grep "FAILED_INITIAL_DELAY"; do '
'echo "Waiting for replica to be failed..."; sleep 5; '
's=$(sky serve status); echo "$s"; done;',
f's=$(sky serve status {name}); echo "$s"; done;',
'sleep 60',
f'{_SERVE_STATUS_WAIT.format(name=name)}; echo "$s" | grep "{name}" | grep "FAILED_INITIAL_DELAY" | wc -l | grep 2',
f'sky ser ve update {name} --cloud {generic_cloud} -y tests/skyserve/failures/probing.yaml',
_SERVE_WAIT_UNTIL_READY.format(name=name, replica_num=1),
f's=$(sky serve status {name}); '
f'until ! echo "$s" | grep "FAILED_PROBING"; do '
f'until echo "$s" | grep "FAILED_PROBING"; do '
'echo "Waiting for replica to be failed..."; sleep 5; '
's=$(sky serve status); echo "$s"; done;' +
f's=$(sky serve status {name}); echo "$s"; done;' +
_check_replica_in_status(
name, [(1, True, 'FAILED_PROBING'),
(1, True, _SERVICE_LAUNCHING_STATUS_REGEX)]),
Expand Down

0 comments on commit 0e89159

Please sign in to comment.