test(intake): derive chat-completions fixture created from now#321
Merged
Conversation
The _openai_response() factory hardcoded created=1778698885 (2026-05-13T19:01:25Z). Ingest maps response.created to span started_at, and the spans/traces list endpoints default to a 30-day lookback, so on 2026-06-12T19:01Z the fixture aged out and every list read-back in the file returned empty — 8 of 16 tests failing. Same class of breakage as PR #174. Derive created from time.time() so spans always land inside the lookback. Signed-off-by: Swarom Muley <smuley@nvidia.com>
created from now
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe OpenAI chat completions integration test fixture now generates its mocked response ChangesTest Fixture Timestamp Correction
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Contributor
|
philipmattingly
approved these changes
Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replace the fixed
created: 1778698885(2026-05-13T19:01:25Z) in the chat-completions ingest test factory withint(time.time()).Why
The ingest endpoint maps
response.createdto spanstarted_at, and the spans/traces list endpoints defaultstarted_at_gteto now−30d. At 2026-06-12T19:01Z the fixture crossed that boundary and every list read-back in the file started returning empty — 8 of 16 tests failing (IndexErrorondata[0]or length asserts). The one read-back test without acreatedfield kept passing because ingest falls back toingested_at.Same failure class as #174. That PR pinned reads with an explicit
filter[started_at][gte]because ATIF step timestamps are part of the payload format under test; herecreatedis incidental (no assertion reads it back), so deriving it from now is a one-line fix and keeps the tests exercising the default read path. The OTLP conftest in this suite already derives span times fromnow().Dedupe/hash-fallback tests are unaffected: each reuses a single body dict within the test, so both POSTs carry the same
created.Verification
uv run --frozen pytest services/intake/tests/integration/spans/test_chat_completions_ingest.py -v— 16 passed (8 failed before).Swept intake tests for other fixed timestamps exposed to the lookback:
test_evaluator_results_atif.pyreads back via the evaluator-results endpoint (no lookback default);test_atif_ingest.pyreads were already pinned by #174.Summary by CodeRabbit