Skip to content

bpo-37322: Fix ResourceWarning and exception handling in test (GH-25553) - #25553

Merged
tiran merged 2 commits into
python:masterfrom
tiran:bpo-37322-resourcewarning
Apr 24, 2021
Merged

bpo-37322: Fix ResourceWarning and exception handling in test (GH-25553)#25553
tiran merged 2 commits into
python:masterfrom
tiran:bpo-37322-resourcewarning

Conversation

@tiran

@tirantiran commented Apr 23, 2021

Copy link
Copy Markdown
Member

Handle all OSErrors in a single block. OSError also takes care of
SSLError and socket's connection errors.

Partly reverts commit fb7e750. The
threaded connection handler must not raise an unhandled exception.

https://bugs.python.org/issue37322

@tirantiran added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 23, 2021
@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @tiran for commit a3594aab883ba2e1d47ab853c1301d68c66fe2e3 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 23, 2021
@tiran

Copy link
Copy Markdown
MemberAuthor

Buildbots failed to trigger, let's try again.

@tirantiran added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 23, 2021
@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @tiran for commit a3594aab883ba2e1d47ab853c1301d68c66fe2e3 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 23, 2021
@pablogsalpablogsal added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 23, 2021
@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @pablogsal for commit a3594aab883ba2e1d47ab853c1301d68c66fe2e3 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 23, 2021
Comment threadLib/test/test_ssl.py Outdated
Comment on lines 2484 to 2501

@matthewhughes934matthewhughes934Apr 23, 2021

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a risk of this failing on Windows, or would this be covered by the CI suite? I'm not too familiar with the code (nor windows) so I kept away from this when I was looking around this issue.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Python has pre-commit CI and post-commit buildbots for all major platforms including multiple flavors of Windows.

It doesn't make any sense the raise an exception here. The exception just breaks the handler thread and does not even end up in the test case.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! That clears things up

@tiran
tiranforce-pushed the bpo-37322-resourcewarning branch from a3594aa to 04260c4CompareApril 23, 2021 18:06
@tirantiran added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 23, 2021
@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @tiran for commit 04260c43c5879a7ef3800c045d9dfacab5c225a1 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 23, 2021
@tirantiran added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 23, 2021
@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @tiran for commit 62653f2715fc4e8f9c991b867cee5825fc4d0077 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 23, 2021
@tiran
tiranforce-pushed the bpo-37322-resourcewarning branch from 62653f2 to b0b4024CompareApril 24, 2021 04:57
tiran added 2 commits April 24, 2021 06:59
Handle all OSErrors in a single block. OSError also takes care of
SSLError and socket's connection errors.
Partly reverts commit fb7e750. The
threaded connection handler must not raise an unhandled exception.
Revert 73ea546, increase logging, and improve stability of test.
@tiran
tiranforce-pushed the bpo-37322-resourcewarning branch from b0b4024 to 25fd780CompareApril 24, 2021 04:59
@tirantiran added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 24, 2021
@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @tiran for commit 25fd780 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 24, 2021
@tirantiran changed the title bpo-37322: Fix ResourceWarning and exception handling in testbpo-37322: Fix ResourceWarning and exception handling in test (GH-25553)Apr 24, 2021
@tiran
tiran merged commit c8666cf into python:masterApr 24, 2021
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @tiran for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9.
🐍🍒⛏🤖

@tiran
tiran deleted the bpo-37322-resourcewarning branch April 24, 2021 07:17
@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @tiran, I could not cleanly backport this to 3.9 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker c8666cfa7cdc48915a14cd16095a69029720736a 3.9

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry @tiran, I had trouble checking out the 3.8 backport branch.
Please backport using cherry_picker on command line.
cherry_picker c8666cfa7cdc48915a14cd16095a69029720736a 3.8

@bedevere-bot

Copy link
Copy Markdown

GH-25572 is a backport of this pull request to the 3.9 branch.

@bedevere-bot

Copy link
Copy Markdown

GH-25573 is a backport of this pull request to the 3.8 branch.

tiran added a commit to tiran/cpython that referenced this pull request May 2, 2021
…ythonGH-25553)
Revert 73ea546, increase logging, and improve stability of test.
Handle all OSErrors in a single block. OSError also takes care of
SSLError and socket's connection errors.
Partly reverts commit fb7e750. The
threaded connection handler must not raise an unhandled exception..
(cherry picked from commit c8666cf)
Co-authored-by: Christian Heimes <christian@python.org>
tiran added a commit to tiran/cpython that referenced this pull request May 2, 2021
…ythonGH-25553)
Revert 73ea546, increase logging, and improve stability of test.
Handle all OSErrors in a single block. OSError also takes care of
SSLError and socket's connection errors.
Partly reverts commit fb7e750. The
threaded connection handler must not raise an unhandled exception..
(cherry picked from commit c8666cf)
Co-authored-by: Christian Heimes <christian@python.org>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip newstestsTests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@tiran@bedevere-bot@miss-islington@matthewhughes934@pablogsal@the-knights-who-say-ni