Skip to content

Project tests report unclosed socket warnings #270

@camallen

Description

@camallen

Tests are showing warnings about unclosed sockets (python 3.9).

It appears we we aren't tearing down the request session socket correctly https://stackoverflow.com/questions/48160728/resourcewarning-unclosed-socket-in-python-3-unit-test but I don't see these warnings when using the code (perhaps due to logging contexts?)

From https://github.com/zooniverse/panoptes-python-client/runs/4251790766?check_suite_focus=true

./home/runner/work/panoptes-python-client/panoptes-python-client/panoptes_client/panoptes.py:622: ResourceWarning: unclosed <ssl.SSLSocket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('10.1.1.45', 39214), raddr=('13.107.213.41', 443)>
  return Panoptes.client().get(
ResourceWarning: Enable tracemalloc to get the object allocation traceback

These break the panoptes-cli tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions