fix(tests): explicit yield in test_create_ssl_server_manual_connection_lost#743
Draft
samypr100 wants to merge 2 commits intoMagicStack:masterfrom
Draft
fix(tests): explicit yield in test_create_ssl_server_manual_connection_lost#743samypr100 wants to merge 2 commits intoMagicStack:masterfrom
samypr100 wants to merge 2 commits intoMagicStack:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes
test_context.test_create_ssl_server_manual_connection_lostflakiness that became very apparent when usingPYTHONASYNCIODEBUG=1after Python 3.13.12 and 3.14.3. Previous versions are unaffected because they don't contain the patch introduced by python/cpython#141696 although it may still rarely flake on older versions.After python/cpython#141696
loop.run_in_executor(..., ssl_sock.send)now often resolves without yielding to the event loop whenPYTHONASYNCIODEBUG=1is set. When no yielding happens the SSL incoming buffer never gets the sent data while_app_reading_pausedwas set to true.Looking at the test and context when it was introduced in #348, I believe there was an implicit assumption that
run_in_executorwould yield in this test so that it would go through the expected internal path ofepoll_pwait->buffer_updated_implbefore schedulingcloseflushing process andresume_readingsetting_app_reading_pausedto false.Disclosure: This PR is made by human-only contribution without AI generated code.
Note this PR will remain in draft as it relies on #742 to show success of the CI.