Closed WolfEYc closed 2 months ago
I am able to work around this by doing the ole singleton trick and just create the pool on first use instead of on app startup
class PoolWrapper: pool: Optional[oracledb.AsyncConnectionPool] = None
@asynccontextmanager
async def acquire(self):
if not self.pool:
self.pool = oracledb.create_pool_async(password=MRTE_ORACLE_PWD, **ENV)
async with self.pool.acquire() as conn:
yield conn
Hmm, something else is going on. Just for interest I changed the create_pool_async() call to be marked as async def and the test still hangs. Debugging shows that the "hang" occurs during the first attempt to perform an await. If you hit Ctrl-C the code continues until the cleanup operation takes place. So this would seem to be something with the pytest machinery or the test case in particular and not an issue with the create_pool_async() method at all! If you have other evidence that suggests otherwise, please let me know!
@WolfEYc is there any update on this?
@cjbj My singleton workaround mitigates the issue.
dont need any sql as it is not a sql related error, it is a connection error.
for reference, when running the app normally it works just fine! but pytest it hangs indefinitley @anthony-tuininga