cheroot icon indicating copy to clipboard operation
cheroot copied to clipboard

Unclosed errors in test_ssl on macOS on Python 3.10

Open yihuang opened this issue 3 years ago • 4 comments

I'm submitting a ...

  • [X] 🐞 bug report
  • [ ] 🐣 feature request
  • [ ] ❓ question about the decisions made in the repository

🐞 Describe the bug. What is the current behavior?

What is the motivation / use case for changing the behavior?

💡 To Reproduce

Steps to reproduce the behavior:

$ python3 -mtox

💡 Expected behavior

Tests should pass.

📋 Details

            # the tests can sporadically generate resource warnings
            # due to timing issues
            # all of these sporadic warnings appear to be about socket.socket
            # and have been observed to come from requests connection pool
            msg = str(warn.message)
            if 'socket.socket' in msg:
                pytest.xfail(
                    '\n'.join((
                        'Sometimes this test fails due to '
                        'a socket.socket ResourceWarning:',
                        msg,
                    )),
                )
>           pytest.fail(msg)
E           Failed: unclosed <ssl.SSLSocket fd=16, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0>

...

Results (24.58s):
     138 passed
       5 failed
         - cheroot/test/test_ssl.py:467 test_ssl_env[VerifyMode.CERT_NONE-True-builtin]
         - cheroot/test/test_ssl.py:467 test_ssl_env[VerifyMode.CERT_NONE-False-builtin]
         - cheroot/test/test_ssl.py:467 test_ssl_env[VerifyMode.CERT_OPTIONAL-True-builtin]
         - cheroot/test/test_ssl.py:467 test_ssl_env[VerifyMode.CERT_OPTIONAL-False-builtin]
         - cheroot/test/test_ssl.py:467 test_ssl_env[VerifyMode.CERT_REQUIRED-True-builtin]
       7 xfailed
       6 skipped
       1 rerun

📋 Environment

  • Cheroot version: main branch
  • CherryPy version: X.X.X (if applicable)
  • Python version: 3.10.4
  • OS: macos 12.3.1

📋 Additional context

yihuang avatar May 15 '22 09:05 yihuang

I get these same failures on my workstation.

jaraco avatar Jun 22 '22 01:06 jaraco

When I run the tests on Python 3.9, I get a different failure, but none of those reported above.

jaraco avatar Jun 22 '22 01:06 jaraco

It looks like maybe this issue was encountered in CI and suppressed there only (bff4985d1ade525a4f0fc9aea4c0bb7b8aef7572).

jaraco avatar Jun 22 '22 02:06 jaraco

After expanding the xfail, the tests on Python 3.10 now fail the same as on 3.9 and 3.8.

jaraco avatar Jun 22 '22 02:06 jaraco