Skip to content

asyncio: we should dogfood our own asyncio implementation during automated tests #7059

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

Merged
merged 7 commits into from
Oct 19, 2022

Conversation

jepler
Copy link

@jepler jepler commented Oct 14, 2022

This doesn't work yet. It needs adafruit/Adafruit_CircuitPython_Ticks#8 in order to even fail (rather than skipping the tests). After that, some tests fail and one loops/hangs indefinitely.

Then, we need adafruit/Adafruit_CircuitPython_asyncio#30 to fix the bugs.

Closes #6706

This also depends on adafruit/Adafruit_CircuitPython_Ticks#8
otherwise adafruit_ticks is unimportable and the tests are just skipped.

Several of the tests fail, and one runs forever instead of terminating.

We should fix our asyncio until the tests patch, then incorporate this
change.
@jepler jepler marked this pull request as draft October 14, 2022 19:46
with e.g., 'make TEST_EXTRA="extmod/uasyncio*.py" test'
@jepler
Copy link
Author

jepler commented Oct 14, 2022

Together with these PRs, the tests now pass while using our asyncio module implementation (Adafruit_CircuitPython_asyncio):

@jepler
Copy link
Author

jepler commented Oct 14, 2022

Or maybe it'll succeed and leave me wondering what the heck is up :)

@jepler
Copy link
Author

jepler commented Oct 14, 2022

ah the asyncio tests will be skipped until "try time.ticks_ms" is merged.

jepler and others added 3 commits October 15, 2022 10:49
.. since Adafruit_CircuitPython_asyncio is hard-coded to this _TICKS_PERIOD
not the one that would otherwise be used on Unix

This fixes all the uasyncio test failures on Unix
A task that has been sent to the loop's exception handler due to being
re-scheduled twice will then subsequently cause a `raise None` if it is
subsequently awaited. In the C version of task.py, this causes a segfault.

This makes the await succeed (via raising StopIteration instead).

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
@jepler jepler marked this pull request as ready for review October 19, 2022 16:30
@jepler
Copy link
Author

jepler commented Oct 19, 2022

The frozen modules have all the necessary updates now, so this PR is ready for review @dhalbert

Copy link
Collaborator

@dhalbert dhalbert 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 fixing this up and adding tests!

@dhalbert dhalbert merged commit 31d7c91 into adafruit:main Oct 19, 2022
@dhalbert
Copy link
Collaborator

Six jobs failed for network reasons, and one got stuck for network reasons:

Received 455017511 of 459211815 (99.1%), 0.3 MBs/sec

I have seen this particular stuckness several times, at the same percentage finished. Cancelling the run to stop this from spinning.

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.

USB disconnects with asyncio program that has exception in task
3 participants