Skip to content

Commit 5b0f22e

Browse files
check if new pytest-asyncio version is causing the flake
1 parent b1ab75d commit 5b0f22e

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

google/cloud/alloydbconnector/connector.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -383,23 +383,14 @@ def close(self) -> None:
383383
self.close_async(), loop=self._loop
384384
)
385385
# Will attempt to gracefully shut down tasks for 3s
386-
print("RISHABH DEBUG: before calling close_async()")
387386
close_future.result(timeout=3)
388-
else:
389-
print("RISHABH DEBUG: loop is not running 1")
390387
# if background thread exists for Connector, clean it up
391388
if self._thread.is_alive():
392389
if self._loop.is_running():
393390
# stop event loop running in background thread
394-
print("RISHABH DEBUG: before calling call_soon_threadsafe()")
395391
self._loop.call_soon_threadsafe(self._loop.stop)
396-
else:
397-
print("RISHABH DEBUG: loop is not running 2")
398392
# wait for thread to finish closing (i.e. loop to stop)
399-
print("RISHABH DEBUG: before calling thread.join()")
400393
self._thread.join()
401-
else:
402-
print("RISHABH DEBUG: thread is not alive")
403394
self._closed = True
404395

405396
async def close_async(self) -> None:

requirements-test.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ psycopg2-binary==2.9.9; python_version == "3.9" and sys_platform == "darwin"
1111
psycopg2-binary==2.9.10; python_version != "3.9" or sys_platform != "darwin"
1212

1313
pytest==8.4.0
14-
pytest-asyncio==1.0.0
14+
15+
pytest-asyncio==0.26.0; python_version == "3.9" and sys_platform == "win32"
16+
pytest-asyncio==1.0.0; python_version != "3.9" or sys_platform != "win32"
17+
1518
pytest-cov==6.1.1
1619
pytest-aiohttp==1.1.0
1720
SQLAlchemy[asyncio]==2.0.41

tests/unit/test_connector.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,6 @@ def test_Connector_close_called_multiple_times(credentials: FakeCredentials) ->
241241
# check that connector thread is no longer running
242242
assert connector._thread.is_alive() is False
243243
# call connector.close a second time
244-
assert connector._loop.is_running() is False
245-
print("RISHABH DEBUG: before calling close() a second time")
246244
connector.close()
247245

248246

0 commit comments

Comments
 (0)