Skip to content

Commit b323d55

Browse files
committed
test(telemetry): avoid requiring provider chunk intervals
A streamed response may contain one provider chunk, in which case no inter-chunk interval exists and the optional time_per_output_chunk histogram is empty. Keep the live Ollama test focused on metrics guaranteed by the request while deterministic plugin tests cover interval recording. Assisted-by: Codex Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
1 parent ad5033b commit b323d55

1 file changed

Lines changed: 0 additions & 16 deletions

File tree

test/telemetry/test_metrics_backend.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,6 @@ async def test_ollama_token_metrics_integration(
192192
},
193193
)
194194
ctx = ChatContext()
195-
# A counting prompt reliably spans many output tokens, so the streaming
196-
# branch always sees >=2 chunks (the time_per_output_chunk histogram only
197-
# records inter-chunk intervals; a single-chunk reply like "Hello!" leaves
198-
# it empty — observed in run 33163851256).
199195
ctx = ctx.add(Message(role="user", content="Count from 1 to 10 and nothing else"))
200196

201197
model_options = {ModelOption.STREAM: True} if stream else {}
@@ -253,18 +249,6 @@ async def test_ollama_token_metrics_integration(
253249
assert ttfb_dp is not None, "TTFB should be recorded for streaming requests"
254250
assert ttfb_dp.sum > 0, "TTFB should be > 0"
255251

256-
# With MELLEA_GENERATION_CHUNK_EVENTS enabled, each chunk after the
257-
# first records an inter-chunk interval.
258-
tpoc_dp = _find_histogram_data_point(
259-
metrics_data, "gen_ai.client.operation.time_per_output_chunk"
260-
)
261-
assert tpoc_dp is not None, (
262-
"time_per_output_chunk should be recorded when chunk events are enabled"
263-
)
264-
assert tpoc_dp.count >= 1, (
265-
"at least one inter-chunk interval should be recorded"
266-
)
267-
268252

269253
@pytest.mark.asyncio
270254
@pytest.mark.openai

0 commit comments

Comments
 (0)