freelawproject / doctor

A microservice for document conversion at scale
https://free.law/projects/doctor
BSD 2-Clause "Simplified" License
57 stars 15 forks source link

ResourceWarnings cont. #18

Closed flooie closed 4 years ago

flooie commented 4 years ago

ResourceWarning: Enable tracemalloc to get the object allocation traceback

57 Resource Warnings appeared after the switch to py3.8. We had the same issue in the switch to python 3 for CL.


ResourceWarning: Enable tracemalloc to get the object allocation traceback
13
/opt/hostedtoolcache/Python/3.8.6/x64/lib/python3.8/unittest/case.py:630: ResourceWarning: unclosed <socket.socket fd=5, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0, raddr=/var/run/docker.sock>
14```
mlissner commented 4 years ago

Gonna have a good time knocking these out. Man.

flooie commented 4 years ago

@mlissner - It's my new favorite hobby.

flooie commented 4 years ago

This appears to be caused by the docker sdk client - being created to start the docker clients in the docker sdk that starts our containers in tests without closing the docker clients. A simple client.close() in setup and teardown resolves this issue.