Skip to content

test(metrics): add edge cases for single timestamp, zero latency, and negative SNR - #17

Open
realmaxc wants to merge 1 commit into
fufuchiu:mainfrom
realmaxc:test-metrics-single-timestamp
Open

realmaxc wants to merge 1 commit into
fufuchiu:mainfrom
realmaxc:test-metrics-single-timestamp

Conversation

@realmaxc

Copy link
Copy Markdown

Seven additional tests covering gaps in metrics.py that the existing suite does not reach:

  • inter_token_gaps with a single timestamp → empty array
  • summarize_latency with one timestamp → zero mean/p95 gaps
  • token_accuracy with all correct predictions → 1.0
  • token_accuracy without ignore_index → regular accuracy
  • first_token_latency when first token arrives at the same instant as the request → 0.0
  • percentile with a single observation
  • waveform_snr producing a negative dB value when noise dominates

All 38 tests pass locally (pytest tests/test_metrics.py -q).

@realmaxc
realmaxc requested a review from fufuchiu as a code owner September 10, 2026 04:29
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