-
Notifications
You must be signed in to change notification settings - Fork 95
Closed
Labels
inactiveThis was marked by stalebot as inactiveThis was marked by stalebot as inactivequestionFurther information is requestedFurther information is requested
Description
Hello!
This test case can be used to clarify what is going:
async def test_5529(self):
"5529 - ensure max limit of pool is not exceeded"
proc_name = test_env.get_sleep_proc_name()
async def work(pool: oracledb.AsyncConnectionPool):
while True:
conn = None
try:
conn = await pool.acquire()
async with conn.cursor() as cursor:
await cursor.callproc(proc_name, [5])
break
except Exception as e:
continue
finally:
if conn is not None:
await conn.close()
pool = test_env.get_pool_async(min=0, max=2, increment=1, wait_timeout=500, getmode=oracledb.POOL_GETMODE_TIMEDWAIT)
for _ in range(20):
asyncio.create_task(work(pool))
for _ in range(10):
await asyncio.sleep(0.5)
print(f'opened: {pool.opened} busy: {pool.busy} max: {pool.max}')
self.assertTrue(pool.busy <= pool.max)
Metadata
Metadata
Assignees
Labels
inactiveThis was marked by stalebot as inactiveThis was marked by stalebot as inactivequestionFurther information is requestedFurther information is requested