Merged
Conversation
Co-authored-by: SAKURA-CAT <79990647+SAKURA-CAT@users.noreply.github.com>
Co-authored-by: SAKURA-CAT <79990647+SAKURA-CAT@users.noreply.github.com>
Co-authored-by: SAKURA-CAT <79990647+SAKURA-CAT@users.noreply.github.com>
Co-authored-by: SAKURA-CAT <79990647+SAKURA-CAT@users.noreply.github.com>
…port to top Co-authored-by: SAKURA-CAT <79990647+SAKURA-CAT@users.noreply.github.com>
Co-authored-by: SAKURA-CAT <79990647+SAKURA-CAT@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add tests for TimeoutAdapter
Add unit tests for TimeoutHTTPAdapter
Dec 5, 2025
Member
|
/gemini review |
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds a comprehensive set of unit tests for the TimeoutHTTPAdapter, which is great for ensuring its behavior is correct and preventing future regressions. The tests cover initialization, timeout injection logic, and integration with create_session. The fix in tutils/check.py to gracefully handle a missing swanboard package is also a good improvement.
I've left a couple of suggestions for minor improvements:
- In
tutils/check.py, the logic for parsing the package version can be made more robust and secure. - In
test/unit/core_python/test_session.py, one of the tests has a redundant assertion that can be removed to improve clarity.
Overall, this is a solid contribution that improves the test coverage and robustness of the codebase.
Improves the extraction of the swanboard version from pip output by handling whitespace and line endings more robustly.
SAKURA-CAT
approved these changes
Dec 5, 2025
Zeyi-Lin
approved these changes
Dec 5, 2025
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.
Description
Adds comprehensive unit tests for
TimeoutHTTPAdapterto validate timeout injection behavior and parameter handling.Closes: #1358
🎯 PRs Should Target Issues
Before your create a PR, please check to see if there is an existing issue
for this change. If not, please create an issue before you create this PR, unless the fix is very small.
Not adhering to this guideline will result in the PR being closed.
Test Coverage
Added 8 tests covering:
create_session()uses DEFAULT_TIMEOUT (60s), correct inheritance from HTTPAdapterTests use
unittest.mock.patchto verify timeout values passed to parentsend()method.Additional Changes
Fixed
tutils/check.pyto handle missing swanboard package gracefully (prevents IndexError during test setup).Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.