镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Async RPClient doesn't close client session #283

Closed

Description

@apopov-qblox

Describe the bug
_RPClient.__init__ sets self.own_client = False even when own Client is created, so close() doesn't close the aiohttp session.

Steps to Reproduce

from reportportal_client import ClientType, create_client

rp = create_client(ClientType.ASYNC_BATCHED, "http://localhost:8080", "project", api_key="key")
rp.create_task(rp.client.session()).blocking_result()
rp.close()
print(rp.own_client, rp.client._session)  # False <ClientSession ...>

Expected behavior
own_client is True and the session is closed.

Actual behavior
own_client is False and the session stays open (Unclosed client session exception is raised on garbage collection).

Package versions
reportportal-client 5.7.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions