fix otel test

This commit is contained in:
Ishaan Jaff 2024-07-27 15:30:58 -07:00
parent 7dac0e0001
commit 35ecf3c06b

View file

@ -97,6 +97,8 @@ async def test_chat_completion_check_otel_spans():
key = key_gen["key"]
await chat_completion(session=session, key=key, model="fake-openai-endpoint")
await asyncio.sleep(3)
otel_spans = await get_otel_spans(session=session, key=key)
print("otel_spans: ", otel_spans)
@ -108,8 +110,8 @@ async def test_chat_completion_check_otel_spans():
print("Parent trace spans: ", parent_trace_spans)
# either 4 or 5 traces depending on how many redis calls were made
assert len(parent_trace_spans) == 5 or len(parent_trace_spans) == 4
# either 5 or 6 traces depending on how many redis calls were made
assert len(parent_trace_spans) == 6 or len(parent_trace_spans) == 5
# 'postgres', 'redis', 'raw_gen_ai_request', 'litellm_request', 'Received Proxy Server Request' in the span
assert "postgres" in parent_trace_spans