Open mhrabovcin opened 5 years ago
Hello @mhrabovcin , thank you for filling this issue.
As far as I understand your issue, you have an error one of your test case.
Can you fill the issue with more context? For example looking at the code you pasted, we can't see how the cli
object was initialized.
Thank you!
The initialization of the client: https://github.com/dcos/bouncer/blob/4beab0338e6859508d58f254d52942cd7bdd9fbd/tests/containers/containerbase.py#L33-L55
The code that is interacting with library: https://github.com/dcos/bouncer/blob/4beab0338e6859508d58f254d52942cd7bdd9fbd/tests/containers/cockroach.py
@rumpl or @ulyssessouza PTAL
I have seen a similar problem:
==================================== ERRORS ====================================
_________ ERROR at teardown of my_proprietary_test __________
@pytest.fixture(scope="session", autouse=True)
def docker_logs():
client = docker.from_env()
threads = []
for container in client.containers.list():
name = container.name or container.id
monitor = CmdStdOutThreadedPrinter(container, name)
threads.append(monitor)
monitor.start_process()
yield None
sleep(2)
for thread in threads:
> thread.stop()
test/system_tests/conftest.py:99:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test/system_tests/threaded_stdout_printer.py:54: in stop
sock = self.client.api._get_raw_response_socket(self.logs._response)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <docker.api.client.APIClient object at 0x7f285c597e50>
response = <Response [200]>
def _get_raw_response_socket(self, response):
self._raise_for_status(response)
if self.base_url == "http+docker://localnpipe":
sock = response.raw._fp.fp.raw.sock
elif self.base_url.startswith('http+docker://ssh'):
sock = response.raw._fp.fp.channel
else:
> sock = response.raw._fp.fp.raw
E AttributeError: 'NoneType' object has no attribute 'raw'
/opt/pysetup/.venv/lib/python3.9/site-packages/docker/api/client.py:324: AttributeError
docker-py
version:3.7.0
python
version:3.6.6
docker
version:Code
Failure