Skip to content

Commit 9e115be

Browse files
committed
Remove executor closes
1 parent 47b8c9d commit 9e115be

File tree

5 files changed

+6
-13
lines changed

5 files changed

+6
-13
lines changed

.evergreen/run-tests.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,15 @@ if [ -z "$GREEN_FRAMEWORK" ]; then
274274

275275
# Workaround until unittest -> pytest conversion is complete
276276
if [ -z "$TEST_SUITES" ]; then
277-
PYTEST_ARGS="$PYTEST_ARGS -m asyncio"
277+
PYTEST_ARGS="-m asyncio --junitxml=xunit-results/TEST-asyncresults.xml $PYTEST_ARGS"
278+
# shellcheck disable=SC2048
279+
uv run ${UV_ARGS[*]} pytest $PYTEST_ARGS
280+
else
281+
PYTEST_ARGS="-m $TEST_SUITES and asyncio --junitxml=xunit-results/TEST-asyncresults.xml $PYTEST_ARGS"
278282
# shellcheck disable=SC2048
279283
uv run ${UV_ARGS[*]} pytest $PYTEST_ARGS
280284
fi
285+
281286
else
282287
# shellcheck disable=SC2048
283288
uv run ${UV_ARGS[*]} green_framework_test.py $GREEN_FRAMEWORK -v $TEST_ARGS

pymongo/asynchronous/mongo_client.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1561,8 +1561,6 @@ async def close(self) -> None:
15611561
# Stop the periodic task thread and then send pending killCursor
15621562
# requests before closing the topology.
15631563
self._kill_cursors_executor.close()
1564-
if not _IS_SYNC:
1565-
await self._kill_cursors_executor.join()
15661564
await self._process_kill_cursors()
15671565
await self._topology.close()
15681566
if self._encrypter:

pymongo/asynchronous/monitor.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,6 @@ def gc_safe_close(self) -> None:
191191

192192
async def close(self) -> None:
193193
self.gc_safe_close()
194-
if not _IS_SYNC:
195-
await self._executor.join()
196194
await self._rtt_monitor.close()
197195
# Increment the generation and maybe close the socket. If the executor
198196
# thread has the socket checked out, it will be closed when checked in.
@@ -460,8 +458,6 @@ def __init__(self, topology: Topology, topology_settings: TopologySettings, pool
460458

461459
async def close(self) -> None:
462460
self.gc_safe_close()
463-
if not _IS_SYNC:
464-
await self._executor.join()
465461
# Increment the generation and maybe close the socket. If the executor
466462
# thread has the socket checked out, it will be closed when checked in.
467463
await self._pool.reset()

pymongo/synchronous/mongo_client.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,8 +1555,6 @@ def close(self) -> None:
15551555
# Stop the periodic task thread and then send pending killCursor
15561556
# requests before closing the topology.
15571557
self._kill_cursors_executor.close()
1558-
if not _IS_SYNC:
1559-
self._kill_cursors_executor.join()
15601558
self._process_kill_cursors()
15611559
self._topology.close()
15621560
if self._encrypter:

pymongo/synchronous/monitor.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,6 @@ def gc_safe_close(self) -> None:
191191

192192
def close(self) -> None:
193193
self.gc_safe_close()
194-
if not _IS_SYNC:
195-
self._executor.join()
196194
self._rtt_monitor.close()
197195
# Increment the generation and maybe close the socket. If the executor
198196
# thread has the socket checked out, it will be closed when checked in.
@@ -460,8 +458,6 @@ def __init__(self, topology: Topology, topology_settings: TopologySettings, pool
460458

461459
def close(self) -> None:
462460
self.gc_safe_close()
463-
if not _IS_SYNC:
464-
self._executor.join()
465461
# Increment the generation and maybe close the socket. If the executor
466462
# thread has the socket checked out, it will be closed when checked in.
467463
self._pool.reset()

0 commit comments

Comments
 (0)