-
Notifications
You must be signed in to change notification settings - Fork 689
test: Simplify test_indexers_sync() with the new helper send_request_via_python_kv_router() #3333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Paul Li <[email protected]>
Signed-off-by: Paul Li <[email protected]>
create a new helper function named send_request_to_specified_mocker_instence to send request directly to the specified mocker instance by moving up and enhancing the old wait_for_mocker_ready function nested in test_kv_push_router_bindings. The function is used by test_kv_push_router_bindings replacing the old one and will be reused by new test functions. Signed-off-by: Paul Li <[email protected]>
Signed-off-by: Paul Li <[email protected]>
Signed-off-by: Paul Li <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Paul Li <[email protected]>
Signed-off-by: Paul Li <[email protected]>
Signed-off-by: Paul Li <[email protected]>
Signed-off-by: Paul Li <[email protected]>
Signed-off-by: Paul Li <[email protected]>
Signed-off-by: Paul Li <[email protected]>
Signed-off-by: Paul Li <[email protected]>
Signed-off-by: Paul Li <[email protected]>
Signed-off-by: Paul Li <[email protected]>
Signed-off-by: Paul Li <[email protected]>
Signed-off-by: Paul Li <[email protected]>
Signed-off-by: Paul Li <[email protected]>
Signed-off-by: Paul Li <[email protected]>
Signed-off-by: Paul Li <[email protected]>
Signed-off-by: Paul Li <[email protected]>
Signed-off-by: Paul Li <[email protected]>
Signed-off-by: Paul Li <[email protected]>
Signed-off-by: Paul Li <[email protected]>
Refactor router tests to initialize mockers and simplify request handling. Signed-off-by: Paul Li <[email protected]>
…on_kv_router Signed-off-by: Paul Li <[email protected]>
|
👋 Hi zhixiongli2011! Thank you for contributing to ai-dynamo/dynamo. Just a reminder: The 🚀 |
WalkthroughA new helper, send_request_via_python_kv_router(...), is added to centralize test routing/streaming with retries, SSE aggregation, and stop conditions. Existing end-to-end router tests are refactored to use this helper for readiness checks and generation scenarios, replacing prior inline logic while retaining test assertions and structure. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Test as Test Case
participant Helper as send_request_via_python_kv_router
participant Router as KvPushRouter
participant SSE as SSE Stream
Test->>Helper: invoke(..., stop_conditions, overrides)
loop exponential backoff until ready/success
Helper->>Router: send request (config/overrides)
Router-->>Helper: stream handle / URL
Helper->>SSE: subscribe
alt stream tokens
SSE-->>Helper: token_id chunk
Helper->>Helper: aggregate, check stop/max_tokens/ignore_eos
else error/end
SSE-->>Helper: end/error
end
Helper-->>Test: boolean success (and aggregated token_ids)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
Pre-merge checks❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
tests/router/test_router_e2e_with_mockers.py(8 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
tests/router/test_router_e2e_with_mockers.py (3)
lib/bindings/python/src/dynamo/_core.pyi (7)
KvPushRouter(1126-1225)generate(1147-1179)endpoint(82-86)KvRouterConfig(739-741)block_size(497-501)block_size(520-524)block_size(1117-1124)lib/bindings/python/rust/llm/kv.rs (4)
generate(1077-1144)block_size(437-439)block_size(498-500)block_size(962-964)lib/llm/src/kv_router.rs (3)
generate(441-470)generate(531-610)block_size(410-412)
🪛 GitHub Actions: Pre Merge Validation of (ai-dynamo/dynamo/refs/pull/3333/merge) by zhixiongli2011.
tests/router/test_router_e2e_with_mockers.py
[error] 1-1: Black formatting failed: 1 file reformatted by this hook. Run 'pre-commit run --all-files' locally or commit again to apply changes.
🪛 Ruff (0.13.1)
tests/router/test_router_e2e_with_mockers.py
324-324: Do not catch blind exception: Exception
(BLE001)
330-332: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling
(B904)
330-332: Avoid specifying long messages outside the exception class
(TRY003)
713-713: Standard pseudo-random generators are not suitable for cryptographic purposes
(S311)
714-714: Standard pseudo-random generators are not suitable for cryptographic purposes
(S311)
839-839: Standard pseudo-random generators are not suitable for cryptographic purposes
(S311)
857-857: Standard pseudo-random generators are not suitable for cryptographic purposes
(S311)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build and Test - dynamo
Signed-off-by: Paul Li <[email protected]>
|
@PeaBrane Good evening, please help view this PR. |
Signed-off-by: Paul Li <[email protected]>
Comment out the worker_id parameter in the function call. Signed-off-by: Paul Li <[email protected]>
Signed-off-by: Paul Li <[email protected]>
|
need to rebase the code |
Overview:
Simplify test_indexers_sync() with the new helper send_request_via_python_kv_router()
Details:
test_indexers_synctest.log.txt
Where should the reviewer start?
Python file: tests/router/test_router_e2e_with_mockers.py
Function: test_indexers_sync()
Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
Summary by CodeRabbit