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
BUG: Tests on windows can be flaky #313
Comments
I did some searches some time ago and I feel it is related to EvenLoop implementations on Windows: https://docs.python.org/3/library/asyncio-eventloop.html#event-loop-implementations Asyncio uses a different, ProactorEventLoop by default on Windows, which could be causing some differences with Unix setups. I'll try to dig more to see if I can find something more concrete for it. |
Many folks seem to work-around the issue by replacing the default ProactorEventLoop on windows with the SelectorEventLoop (default for Unix, but supports Windows too). |
@maxking would that be something easy to do at the very least just in the test suite when on Windows? My guess is that it should be but it's been a while since I looked at the code 😅 If it is, that seems like a reasonable thing to do - but we should definitely document it both in the documentation (e.g. "Just a warning folks, if you're using Windows you might run into problems here!") as well as note the why in the code. But... unless there's a super obvious answer or fix in upstream asyncio, I'd be 👍 on merging a well documented workaround. |
Searching a bit more, it looks like interaction between We do however use In our case, we are using the fixture A rather simple fix would be to just bump this to 2 (or see how many failures we see with 1.5 and then go to 2 as they will add-up with multiple tests). If that sounds reasonable, I can open a PR with whatever updated delay you prefer. |
That makes sense - and I prefer that to changing out the event loop, if it solves our issue 👍 |
Awesome, I created #315 to bump it to 1.5s for now. |
Since the PR is merged, let's close this :-) |
https://github.com/aio-libs/aiosmtpd/actions/runs/3365228777/jobs/5580522249
https://github.com/aio-libs/aiosmtpd/actions/runs/3371138286/jobs/5593013500
The text was updated successfully, but these errors were encountered: