Matthew Hughes <[email protected]> added the comment:
I noticed this test was still emitting a "ResourceWarning":
----------------------------------------------------------------------
$ ./python -m test test_ssl -m TestPostHandshakeAuth
0:00:00 load avg: 0.74 Run tests sequentially
0:00:00 load avg: 0.74 [1/1] test_ssl
/home/mjh/src/cpython/Lib/test/support/threading_helper.py:209:
ResourceWarning: unclosed <ssl.SSLSocket fd=5, family=AddressFamily.AF_INET,
type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 33451),
raddr=('127.0.0.1', 34038)>
del self.thread
ResourceWarning: Enable tracemalloc to get the object allocation traceback
== Tests result: SUCCESS ==
1 test OK.
Total duration: 1.1 sec
Tests result: SUCCESS
----------------------------------------------------------------------
and thought I would try silencing it by ensuring the SSL connection handled by
the separate thread was closed before exiting. My attempt involved checking the
thread's exception and acting accordingly, but I ran into a race condition
which (solely as a proof of concept) I resolved by adding a sleep() call (see
patch).
While I continue to search for a proper resolution I was wondering what
approach someone with more insight might suggest.
----------
nosy: +mhughes
Added file: https://bugs.python.org/file49294/naive_proof_of_concept.patch
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue37322>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com