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

Fix integration test for span cleanup #1374

Merged
merged 1 commit into from
Feb 7, 2025
Merged

Conversation

nnarayen
Copy link
Contributor

@nnarayen nnarayen commented Feb 7, 2025

🚀 What

A previous PR broke integration tests after unintentionally changing the behavior of semaphore cleanup code.

💻 How

🔬 Testing

$ poetry run pytest truss/tests/test_model_inference.py::test_streaming_truss_with_user_tracing

now passes

@nnarayen nnarayen requested a review from squidarth February 7, 2025 18:32
@nnarayen nnarayen force-pushed the nikhil/fix-integration-test branch from 6537fb4 to 47bc00e Compare February 7, 2025 18:33
@@ -824,7 +824,7 @@ async def __call__(
predict_result,
span_predict,
detached_ctx,
release_and_end=get_defer_fn(),
get_cleanup_fn=get_defer_fn,
Copy link
Contributor Author

@nnarayen nnarayen Feb 7, 2025

Choose a reason for hiding this comment

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

Previously, we'd only request the defer_fn if we knew we were going to execute it explicitly, which prevents the default behavior of releasing the semaphore (and ending a span). My refactor unintentionally changed this behavior, so that we wouldn't release the semaphore if we invoked my new shared helper. Very lucky the integration test caught this.

@nnarayen nnarayen merged commit ad03bf9 into main Feb 7, 2025
5 checks passed
@nnarayen nnarayen deleted the nikhil/fix-integration-test branch February 7, 2025 18:37
nnarayen added a commit that referenced this pull request Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants