Skip to content

[serve] Improve test_metrics#53747

Merged
zcin merged 1 commit intoray-project:masterfrom
zcin:test-metrics-obs
Jun 12, 2025
Merged

[serve] Improve test_metrics#53747
zcin merged 1 commit intoray-project:masterfrom
zcin:test-metrics-obs

Conversation

@zcin
Copy link
Copy Markdown
Contributor

@zcin zcin commented Jun 11, 2025

Why are these changes needed?

Make it easier to debug metrics test failures

Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR aims to improve test debugging for metrics failures by enhancing the filtering and formatting of metric outputs.

  • Importing the JSON module to format metric outputs
  • Filtering metrics to only include those with the "ray_serve_" prefix
  • Enhancing assertion error messages and debugging print statements with JSON formatting for clarity

), f"The following metrics don't sum to {expected}: {metric_samples}. {metrics}"
assert float(metric_sum) == float(expected), (
f"The following metrics don't sum to {expected}: "
f"{json.dumps(metric_samples, indent=4)}\n."
Copy link

Copilot AI Jun 11, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider reviewing the punctuation in the error message; the '\n.' may be unintended and could be removed or clarified for better readability.

Suggested change
f"{json.dumps(metric_samples, indent=4)}\n."
f"{json.dumps(metric_samples, indent=4)}\n"

Copilot uses AI. Check for mistakes.
@zcin zcin added the go add ONLY when ready to merge, run all tests label Jun 11, 2025
@zcin zcin enabled auto-merge (squash) June 11, 2025 22:48
@zcin zcin merged commit d3fd0d2 into ray-project:master Jun 12, 2025
6 checks passed
@zcin zcin deleted the test-metrics-obs branch June 12, 2025 00:02
elliot-barn pushed a commit that referenced this pull request Jun 18, 2025
## Why are these changes needed?

Make it easier to debug metrics test failures

Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
elliot-barn pushed a commit that referenced this pull request Jul 2, 2025
## Why are these changes needed?

Make it easier to debug metrics test failures

Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.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.

3 participants