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

Fix failing tests, including in ofrak-core-dev docker with Python3.11 #572

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ANogin
Copy link
Collaborator

@ANogin ANogin commented Jan 15, 2025

  • I have reviewed the OFRAK contributor guide and attest that this pull request is in accordance with it.
  • I have made or updated a changelog entry for the changes in this pull request.

One sentence summary of this PR (This should go in the CHANGELOG!)
Fixed two tests - one was failing starting with Python 3.11 and another is probably an intermittent failure that existed for a while.

Link to Related Issue(s)
#352

Please describe the changes in your request.

  • ofrak_io/ofrak_io/batch_manager.py - starting with Python3.11, coroutines cannot be passed to asyncio.wait directly, and have to be wrapped in a future or a task. This wraps it using asyncio.ensure_future
  • ofrak_core/ofrak/ofrak_context.py: OFRAK.run used asyncio.new_event_loop().run_until_complete which meant that the first time it was executed, it will delete the loop at the end of the run, and will then fail with a RuntimeException on any further calls. This means that during testing, if two tests using this function happened to be assigned to the same runner process, then the 2nd test would fail. Changed it by creating a separate asyncio loop for each call, so that it does not mess with the default loop.

Anyone you think should look at this, specifically?
@whyitfor

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.

1 participant