Skip to content

test(huggingface_hub): Parametrize tests on the streaming trace lifecycle - #7436

Merged
alexander-alderman-webb merged 3 commits into
masterfrom
webb/huggingface-hub/span-streaming
Sep 9, 2026
Merged

test(huggingface_hub): Parametrize tests on the streaming trace lifecycle#7436
alexander-alderman-webb merged 3 commits into
masterfrom
webb/huggingface-hub/span-streaming

Conversation

@alexander-alderman-webb

Copy link
Copy Markdown
Contributor

Description

Add streaming tests, as we only keep these in the major.

Issues

Reminders

@alexander-alderman-webb
alexander-alderman-webb marked this pull request as ready for review September 8, 2026 14:56
@alexander-alderman-webb
alexander-alderman-webb requested a review from a team as a code owner September 8, 2026 14:56
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

131876 passed | ⏭️ 7131 skipped | Total: 139007 | Pass Rate: 94.87% | Execution Time: 471m 46s

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +1080
Passed Tests 📈 +1080
Failed Tests
Skipped Tests

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 2514 uncovered lines.
✅ Project coverage is 90.25%. Comparing base (053059e) to head (3bf8a50).

Coverage diff
@@            Coverage Diff             @@
##        master       #PR       +/-##
==========================================
+ Coverage    90.25%    90.25%        —%
==========================================
  Files          193       193         —
  Lines        25774     25774         —
  Branches      9514      9514         —
==========================================
+ Hits         23259     23260        +1
- Misses        2515      2514        -1
- Partials      1433      1432        -1

Generated by Codecov Action

@alexander-alderman-webb
alexander-alderman-webb removed this pull request from stack #7437 September 9, 2026 07:18
Base automatically changed from webb/huggingface-hub/approx-dict to master September 9, 2026 07:20
@alexander-alderman-webb
alexander-alderman-webb merged commit ffac8f2 into master Sep 9, 2026
159 checks passed
@alexander-alderman-webb
alexander-alderman-webb deleted the webb/huggingface-hub/span-streaming branch September 9, 2026 07:34
Comment on lines 2243 to 2245
with sentry_sdk.start_transaction(name="test"):
for _ in client.text_generation(prompt="Hello", stream=True, details=True):
pass

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

span_streaming path still uses start_transaction and can fail the suite

When span_streaming=True, use sentry_sdk.traces.start_span (and flush) instead of sentry_sdk.start_transaction, matching test_text_generation_streaming; otherwise the call is a NoOpSpan and emits a DeprecationWarning that the session warning recorder treats as a failure.

Evidence
  • Scope.start_transaction() returns NoOpSpan() and warns "Scope.start_transaction is not available in streaming mode." when has_span_streaming_enabled is true.
  • HF still creates a real streamed gen_ai span via sentry_sdk.traces.start_span when span streaming is enabled, so the assert path can pass while still recording that deprecation.
  • Session fixture _capture_internal_warnings fails the suite on unfiltered sentry_sdk DeprecationWarnings; nearby HF tests already branch to traces.start_span for span_streaming=True.

Identified by Warden · find-bugs · YT6-9B8

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