fix: handle proxy internal callbacks in callback management test (#12294)

The test_list_callbacks_mixed_callback_types test was failing when run in parallel with other tests due to the proxy server's internal _PROXY_VirtualKeyModelMaxBudgetLimiter callback persisting across test runs. This fix filters out proxy internal callbacks from the test assertions to ensure consistent test behavior regardless of test execution order or parallelization.
This commit is contained in:
Cole McIntosh 2025-07-03 14:28:46 -07:00 • committed by GitHub
parent 03a589d323
commit adfe63cf3a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -169,6 +169,15 @@ class TestCallbackManagementEndpoints:
response_data = response.json()
# Filter out any proxy-specific callbacks that might be present from parallel test runs
# These are internal callbacks that can persist when tests run in parallel
proxy_internal_callbacks = ["_PROXY_VirtualKeyModelMaxBudgetLimiter"]
response_data["success_and_failure"] = [
cb for cb in response_data["success_and_failure"]
if cb not in proxy_internal_callbacks
]
# Verify callbacks are properly categorized
assert "prometheus" in response_data["success_and_failure"] # callbacks list items go to success_and_failure
assert "langfuse" in response_data["success"]