-
Notifications
You must be signed in to change notification settings - Fork 583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serve log before termination for smoke tests #4691
Serve log before termination for smoke tests #4691
Conversation
42cbf05
to
23670b2
Compare
/smoke-test --kubernetes |
tests/smoke_tests/test_sky_serve.py
Outdated
# "Services" section), increment a counter. Skip the first line (header) and | ||
# print the first column (service name) for subsequent lines. | ||
_SHOW_SERVE_STATUS = ( | ||
'sky status --refresh | awk \'' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use sky serve status
and why we use --refresh
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated with sky serve status
tests/smoke_tests/test_sky_serve.py
Outdated
_SHOW_SERVE_STATUS = ( | ||
'sky serve status | awk \'' | ||
'/^Services$/{{flag=1; next}} ' | ||
'/^$/{{flag=0}} ' | ||
'flag {{if (++count > 1) print $1}}\' | ' | ||
'while read -r service_name; do ' | ||
' echo "+ sky serve logs --controller $service_name --no-follow"; ' | ||
' sky serve logs --controller $service_name --no-follow; ' | ||
' echo "+ sky serve logs --load-balancer $service_name --no-follow"; ' | ||
' sky serve logs --load-balancer $service_name --no-follow; ' | ||
'done; ') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will show the logs for all services? What if there are multiple tests running for skyserve? Wouldn't this mess up the output of the test with outputs from other tests?
Also, would any failure of these commands cause leakage replica resources as service termination commands may not be called afterwards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now pass the {name}
to display specific services only.
The command format is cmdA; cmdB; cmdC; ...
. If cmdA
fails, cmdB
will still execute — that's how bash runs commands.
/smoke-test --managed-jobs |
/smoke-test --k test_multi_tenant |
/smoke-test -k test_multi_tenant |
1 similar comment
/smoke-test -k test_multi_tenant |
/smoke-test --kubernetes -k test_managed_jobs_basic |
@romilbhardwaj Could u help review? |
@@ -69,12 +69,19 @@ def _get_service_name() -> str: | |||
_IP_REGEX = r'([0-9]{1,3}\.){3}[0-9]{1,3}' | |||
_AWK_ALL_LINES_BELOW_REPLICAS = r'/Replicas/{flag=1; next} flag' | |||
_SERVICE_LAUNCHING_STATUS_REGEX = 'PROVISIONING\|STARTING' | |||
|
|||
_SHOW_SERVE_STATUS = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a quick sky serve status
before the logs commands?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@romilbhardwaj Could you help take another look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @zpoint!
@@ -69,12 +69,21 @@ def _get_service_name() -> str: | |||
_IP_REGEX = r'([0-9]{1,3}\.){3}[0-9]{1,3}' | |||
_AWK_ALL_LINES_BELOW_REPLICAS = r'/Replicas/{flag=1; next} flag' | |||
_SERVICE_LAUNCHING_STATUS_REGEX = 'PROVISIONING\|STARTING' | |||
|
|||
_SHOW_SERVE_STATUS = ( | |||
'echo "+ sky serve status {name}"; ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these echo statements necessary? I thought the command being executed was automatically echo'd by our tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our tests didn’t echo the teardown
command, and I think it’s better to keep the lower granularity, like the current sky serve status {name}
, rather than something like echo "_AWK....1000 characters other command; {sky serve status {name}}"
.
Tested (run the relevant ones):
bash format.sh
pytest tests/test_smoke.py
pytest tests/test_smoke.py::test_fill_in_the_name
conda deactivate; bash -i tests/backward_compatibility_tests.sh