Skip to content

Commit ff838aa

Browse files
committed
new tests on query session pool
1 parent 972732d commit ff838aa

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/aio/query/test_query_session_pool.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,16 @@ async def test_pool_recreates_bad_sessions(self, pool: QuerySessionPoolAsync):
9494
async with pool.checkout() as session:
9595
assert session_id != session._state.session_id
9696
assert pool._current_size == 1
97+
98+
@pytest.mark.asyncio
99+
async def test_no_session_leak(self, driver, docker_project):
100+
pool = ydb.aio.QuerySessionPoolAsync(driver, 1)
101+
docker_project.stop()
102+
try:
103+
await pool.acquire(timeout=0.5)
104+
except ydb.Error:
105+
pass
106+
assert pool._current_size == 0
107+
108+
docker_project.start()
109+
await pool.stop()

0 commit comments

Comments
 (0)