Skip to content
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

Add httpx session in http.py #475

Merged
merged 4 commits into from
Dec 1, 2024
Merged

Conversation

neochine
Copy link
Contributor

@neochine neochine commented Dec 1, 2024

Copied most of code from async_http.py and managed to pass ruff & mypy llinter. Tests are failing in my computer for some reason, I assume its docker related?

ERROR tests/integration/test_websockets.py::test_vote_subscribe - Exception: Command docker compose -f "/root/My-Computer/My-Working/Github/solana-py/solana-py/tests/docker-compose.yml" -p "pytest21826" up --build -d returned 125: """unknown shorthand fla...

Fixes #474

@neochine
Copy link
Contributor Author

neochine commented Dec 1, 2024

Lots of test are failing due to httpx timeout. Unsure whats the fix apart from increasing httpx default timeout

@neochine
Copy link
Contributor Author

neochine commented Dec 1, 2024

@michaelhly Could workflow tests be approved again so I know the test were failing due to timeout rather than some logic error from this PR

@michaelhly
Copy link
Owner

@neochine it looks like you just need to change this these tests from httpx.ReadTimeout to httpx.ConnectError:

assert exc_info.value.error_msg == "<class 'httpx.ReadTimeout'> raised in \"GetEpochInfo\" endpoint request"

assert exc_info.value.error_msg == "<class 'httpx.ReadTimeout'> raised in \"GetEpochInfo\" endpoint request"

@neochine
Copy link
Contributor Author

neochine commented Dec 1, 2024

Alright, changed

@neochine
Copy link
Contributor Author

neochine commented Dec 1, 2024

Looks like async test raises ReadTimeout (not ConnectError). Only sync test raises ConnectError

Copy link

codecov bot commented Dec 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.01%. Comparing base (07acdac) to head (b751870).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #475      +/-   ##
==========================================
+ Coverage   91.00%   91.01%   +0.01%     
==========================================
  Files          28       28              
  Lines        2380     2383       +3     
==========================================
+ Hits         2166     2169       +3     
  Misses        214      214              

Copy link
Owner

@michaelhly michaelhly left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

@michaelhly michaelhly merged commit 2afacbd into michaelhly:master Dec 1, 2024
9 checks passed
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.

Any reason to not use httpx.Client and directly use httpx.post?
2 participants