Skip to content
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] Add tests for HTTP status code is_error logic #48822

Merged
merged 12 commits into from
Nov 20, 2024

Conversation

edoakes
Copy link
Contributor

@edoakes edoakes commented Nov 20, 2024

Why are these changes needed?

Adds tests for: #47896 (and some stylistic refactoring).

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
@edoakes edoakes added the go add ONLY when ready to merge, run all tests label Nov 20, 2024
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
@edoakes edoakes enabled auto-merge (squash) November 20, 2024 17:50
@edoakes edoakes disabled auto-merge November 20, 2024 17:50
@edoakes edoakes enabled auto-merge (squash) November 20, 2024 19:34
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
@edoakes edoakes self-assigned this Nov 20, 2024
Copy link
Contributor

@GeneDer GeneDer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

def test_proxy_metrics_websocket_status_code_is_error(serve_start_shutdown):
"""Verify that status codes aisde from 1000 or 1001 are errors."""

def check_request_count_metrics(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocker nit: Can probably refactor this and share with the other test

code=status_code,
# All status codes are considered errors aside from:
# 1000 (CLOSE_NORMAL), 1001 (CLOSE_GOING_AWAY).
is_error=status_code not in ["1000", "1001"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocker nit: can refactor this into a small helper 🙃

@edoakes edoakes merged commit 3a60440 into ray-project:master Nov 20, 2024
6 checks passed
jecsand838 pushed a commit to jecsand838/ray that referenced this pull request Dec 4, 2024
…48822)

Adds tests for: ray-project#47896 (and some
stylistic refactoring).

---------

Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Connor Sanders <connor@elastiflow.com>
dentiny pushed a commit to dentiny/ray that referenced this pull request Dec 7, 2024
…48822)

Adds tests for: ray-project#47896 (and some
stylistic refactoring).

---------

Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: hjiang <dentinyhao@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go add ONLY when ready to merge, run all tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants