Skip to content

test(telemetry): add two supplemental tests for #7694 - #1

Open
GBX-Max1220 wants to merge 1 commit into
ishan-1010:fix-litellm-stream-output-oncefrom
GBX-Max1220:test/7694-supplemental-native-tests
Open

GBX-Max1220 wants to merge 1 commit into
ishan-1010:fix-litellm-stream-output-oncefrom
GBX-Max1220:test/7694-supplemental-native-tests

Conversation

@GBX-Max1220

Copy link
Copy Markdown

Adds two supplemental regression tests for the LiteLlm stream/aggregate fix in google#7694, as a reviewable code diff replacing the earlier ZIP attachment.

Base: 2c5773f0 (current head of fix-litellm-stream-output-once). Only tests/unittests/telemetry/test_instrumentation.py changes; no production code.

  1. test_interrupted_stream_propagates_error_and_keeps_partial_messages — a stream raising before its aggregate re-raises the original exception, keeps the already-recorded partial output messages on the exported span, and finishes with ERROR status.
  2. test_aggregate_is_recorded_once_in_completion_event — under EVENT_ONLY, the completed inference emits a single completion log record whose output messages contain only the aggregate, not the chunks.

No overlap with the four tests already in the PR: the existing cutoff test reads in-flight span details and swallows the error, while the new one asserts exception identity, final exported attributes, and status; all existing tests use SPAN_ONLY, while the new one covers the EVENT_ONLY log path.

Verification (Python 3.12, OTEL_TRACES_SAMPLER=always_on, PYTHONPATH=src):

python -m pytest tests/unittests/telemetry/test_instrumentation.py -q
-> 104 passed, 4 warnings

No full-suite run is claimed.

Cover the LiteLlm aggregate fix from the two gaps left by the existing
tests: an interrupted stream keeps its partial output messages on the
exported span, re-raises the original exception, and ends as ERROR; and
EVENT_ONLY mode emits one completion log record containing only the
aggregate, not the chunks.
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.

1 participant