Skip to content

Conversation

maximpertsov
Copy link
Contributor

@maximpertsov maximpertsov commented Jun 13, 2023

Fixes a regression in the session client for Python versions <= 3.9 that stemmed differences in asyncio's before and after this version: https://docs.python.org/3/whatsnew/3.10.html#removed. This regression was exposed by our integration tests.

=========================== short test summary info ============================
FAILED tests/test.py::TestIntegration::test_unary - RuntimeError: Task <Task pending name='Task-6' coro=<MovementSensorClient.get_linear_velocity() running at /usr/local/lib/python3.8/site-packages/viam/components/movement_sensor/client.py:51> cb=[gather.<locals>._done_callback() at /usr/local/lib/python3.8/asyncio/tasks.py:769]> got Future <Future pending> attached to a different loop

Testing:

@maximpertsov maximpertsov marked this pull request as ready for review June 13, 2023 20:33
@maximpertsov maximpertsov requested a review from a team as a code owner June 13, 2023 20:33
@maximpertsov maximpertsov requested review from clintpurser and stuqdog and removed request for clintpurser and stuqdog June 13, 2023 20:33
@maximpertsov maximpertsov changed the title Pass in loop for python versions 3.9 and earlier Bugfix: Pass in event loop for python versions 3.9 and earlier Jun 13, 2023
@maximpertsov maximpertsov changed the title Bugfix: Pass in event loop for python versions 3.9 and earlier Fix session client for Python versions <= 3.9 Jun 13, 2023
@maximpertsov maximpertsov requested a review from njooma June 13, 2023 20:45
@maximpertsov maximpertsov changed the base branch from main to rc-0.4.0 June 13, 2023 20:49
Copy link
Member

@benjirewis benjirewis left a comment

Choose a reason for hiding this comment

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

Thanks for the quick fix!

Copy link
Member

@njooma njooma left a comment

Choose a reason for hiding this comment

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

Minor nit, shouldn't block merge



def loop_kwargs():
if sys.version_info[:2] <= (3, 9):
Copy link
Member

Choose a reason for hiding this comment

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

You can just do if sys.version_info <= (3, 9)

@maximpertsov maximpertsov changed the base branch from rc-0.4.0 to main June 13, 2023 21:30
@maximpertsov maximpertsov mentioned this pull request Jun 13, 2023
@maximpertsov maximpertsov deleted the loop-regression branch June 13, 2023 21:57
This was referenced Jun 13, 2023
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.

4 participants