Skip to content
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

Tests failing on alpine linux #357

Closed
1 of 3 tasks
a16bitsysop opened this issue Jan 10, 2021 · 3 comments
Closed
1 of 3 tasks

Tests failing on alpine linux #357

a16bitsysop opened this issue Jan 10, 2021 · 3 comments
Labels
bug Something is broken triage

Comments

@a16bitsysop
Copy link

a16bitsysop commented Jan 10, 2021

❓ I'm submitting a ...

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

🐞 Describe the bug. What is the current behavior?

When pytest is run on alpine Linux there are 2 failures with cheroot 8.5.1

cheroot/test/test_conn.py::test_broken_connection_during_tcp_fin[RuntimeError(666)]
  /usr/lib/python3.8/site-packages/_pytest/threadexception.py:75: PytestUnhandledThreadExceptionWarning: Exception in thread CP Server Thread-24

  Traceback (most recent call last):
    File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
      self.run()
    File "/home/working/py3-cheroot/src/cheroot-8.5.1/cheroot/workers/threadpool.py", line 130, in run
      conn.close()
    File "/home/working/py3-cheroot/src/cheroot-8.5.1/cheroot/server.py", line 1360, in close
      self._close_kernel_socket()
    File "/home/working/py3-cheroot/src/cheroot-8.5.1/cheroot/test/test_conn.py", line 655, in _close_kernel_socket
      old_close_kernel_socket(self)
    File "/home/working/py3-cheroot/src/cheroot-8.5.1/cheroot/server.py", line 1483, in _close_kernel_socket
      shutdown(socket.SHUT_RDWR)  # actually send a TCP FIN
    File "/usr/lib/python3.8/unittest/mock.py", line 1081, in __call__
      return self._mock_call(*args, **kwargs)
    File "/usr/lib/python3.8/unittest/mock.py", line 1085, in _mock_call
      return self._execute_mock_call(*args, **kwargs)
    File "/usr/lib/python3.8/unittest/mock.py", line 1146, in _execute_mock_call
      result = effect(*args, **kwargs)
    File "/usr/lib/python3.8/site-packages/pytest_mock/plugin.py", line 117, in wrapper
      r = method(*args, **kwargs)
    File "/usr/lib/python3.8/unittest/mock.py", line 1081, in __call__
      return self._mock_call(*args, **kwargs)
    File "/usr/lib/python3.8/unittest/mock.py", line 1085, in _mock_call
      return self._execute_mock_call(*args, **kwargs)
    File "/usr/lib/python3.8/unittest/mock.py", line 1140, in _execute_mock_call
      raise effect
  RuntimeError: (666, 'Simulated socket error')

    warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg))

And

cheroot/test/test_conn.py::test_broken_connection_during_tcp_fin[socket.error(-1)]
  /usr/lib/python3.8/site-packages/_pytest/threadexception.py:75: PytestUnhandledThreadExceptionWarning: Exception in thread CP Server Thread-25

  Traceback (most recent call last):
    File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
      self.run()
    File "/home/working/py3-cheroot/src/cheroot-8.5.1/cheroot/workers/threadpool.py", line 130, in run
      conn.close()
    File "/home/working/py3-cheroot/src/cheroot-8.5.1/cheroot/server.py", line 1360, in close
      self._close_kernel_socket()
    File "/home/working/py3-cheroot/src/cheroot-8.5.1/cheroot/test/test_conn.py", line 655, in _close_kernel_socket
      old_close_kernel_socket(self)
    File "/home/working/py3-cheroot/src/cheroot-8.5.1/cheroot/server.py", line 1483, in _close_kernel_socket
      shutdown(socket.SHUT_RDWR)  # actually send a TCP FIN
    File "/usr/lib/python3.8/unittest/mock.py", line 1081, in __call__
      return self._mock_call(*args, **kwargs)
    File "/usr/lib/python3.8/unittest/mock.py", line 1085, in _mock_call
      return self._execute_mock_call(*args, **kwargs)
    File "/usr/lib/python3.8/unittest/mock.py", line 1146, in _execute_mock_call
      result = effect(*args, **kwargs)
    File "/usr/lib/python3.8/site-packages/pytest_mock/plugin.py", line 117, in wrapper
      r = method(*args, **kwargs)
    File "/usr/lib/python3.8/unittest/mock.py", line 1081, in __call__
      return self._mock_call(*args, **kwargs)
    File "/usr/lib/python3.8/unittest/mock.py", line 1085, in _mock_call
      return self._execute_mock_call(*args, **kwargs)
    File "/usr/lib/python3.8/unittest/mock.py", line 1140, in _execute_mock_call
      raise effect
  OSError: [Errno -1] Simulated socket error

    warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg))

❓ What is the motivation / use case for changing the behavior?
Tests need to pass to create a package

πŸ’‘ To Reproduce

Steps to reproduce the behavior:

  1. Try and build a package on alpine Linux
  2. Tests fail

πŸ’‘ Expected behavior

Tests pass, xfail, or skip
πŸ“‹ Details

πŸ“‹ Environment

  • Cheroot version: 8.5.1
  • CherryPy version: X.X.X (if applicable)
  • Python version: 3.8.7
  • OS: alpine:edge
  • Browser: NA

πŸ“‹ Additional context

@a16bitsysop a16bitsysop added bug Something is broken triage labels Jan 10, 2021
@webknjaz
Copy link
Member

As a workaround, either use pytest below 6.2.0 or disable the new plugins that cause these warnings. See the changelog for pytest v6.2.0 for more details.

@webknjaz
Copy link
Member

Duplicate of #355

@webknjaz webknjaz marked this as a duplicate of #355 Jan 10, 2021
@a16bitsysop
Copy link
Author

Okay thanks, to get the tests to pass I remove error from pytest.ini

filterwarnings =
-    error

And use:

pytest -W ignore::DeprecationWarning \
                --deselect=cheroot/test/test_ssl.py::test_tls_client_auth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken triage
Projects
None yet
Development

No branches or pull requests

2 participants