-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
bpo-35998: Avoid TimeoutError in test_asyncio: test_start_tls_server_1() #14080
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I just have a minor comment.
On Fedora 30, reproducing the take takes me 5 seconds using (the test hangs for a few minutes and then fail):
./python -m test test_asyncio -m test_start_tls_server_1 -F
With this change, the test no longer hangs.
I can ./python -m test test_asyncio -m test_start_tls_server_1 -F
6 times in parallel for 5 minutes, my system load is around 7.0 (the system is very busy), and the test still doesn't hang. So I can confirm that this change fix the issue for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
GH-14084 is a backport of this pull request to the 3.8 branch. |
Sorry, @asvetlov and @vstinner, I could not cleanly backport this to |
I'll make backport myself |
GH-14086 is a backport of this pull request to the 3.7 branch. |
@asvetlov: I just made it :-) I really want this bug to go away, it annoy me on buildbots for 6 months at least. It was a stupid conflict on additional "loop=self.loop" in 3.7. |
Yes, I see. |
The test was not robust because it used to rely on
sock.shutdown(socket.SHUT_RDWR)
beforesock.close()
.Actually, sometimes these socket state changes are merged into the just transition into the socket-closed state on the peer side. I don't want to add sleep(N) between calls, it is the easiest way to add new test flakiness.
The
start_tls
test doesn't need to checkproto.eof_received()
callback receiving, there are other explicit tests for it.The test is changed to receive TSL encrypted data and send an acknowledgment back before client socket closing.
Now everything works smoothly, I don't see any timeout exceptions even under very heavy testing.
https://bugs.python.org/issue35998