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 Event.wait() cancellation race causing failure to notify all waiting tasks #537

Closed

Conversation

gschaffner
Copy link
Collaborator

fixes #536!

Comment on lines +22 to +33
# Use the inherited anyio_backend, but filter out non-asyncio
anyio_backend = pytest.fixture(
params=[
param
for param in cast(Any, getfixturemarker(parent_anyio_backend)).params
if any(
"asyncio"
in anyio_backend_name.__wrapped__(backend) # type: ignore[attr-defined]
for backend in param.values
)
]
)(parent_anyio_backend.__wrapped__)
Copy link
Collaborator Author

@gschaffner gschaffner Mar 8, 2023

Choose a reason for hiding this comment

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

i am not very happy with this pytest hack, but i wanted to avoid having to redefine the asyncio and asyncio+uvloop backends already defined elsewhere.

using pytest.mark.skipif to skip the trio backend on this whole module is perhaps a better option than this hack, but it means pytest emitting skips for a third of the tests in a module. (given, this module is currently tiny (and should hopefully remain so!).)

pytest-dev/pytest#3730 would be helpful here though.

@agronholm
Copy link
Owner

Closing in favor of #595.

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.

On asyncio, Event.set() sometimes fails to notify all waiting tasks
2 participants