From 8b52d99d73e5a38b262663f9629ebdbf6f2bcf70 Mon Sep 17 00:00:00 2001 From: Shane Harvey <shnhrv@gmail.com> Date: Tue, 4 Mar 2025 15:27:05 -0800 Subject: [PATCH] PYTHON-5167 Properly cleanup test SpecRunnerTask --- test/asynchronous/unified_format.py | 1 + test/unified_format.py | 1 + 2 files changed, 2 insertions(+) diff --git a/test/asynchronous/unified_format.py b/test/asynchronous/unified_format.py index c3931da936..d4c3d40d20 100644 --- a/test/asynchronous/unified_format.py +++ b/test/asynchronous/unified_format.py @@ -384,6 +384,7 @@ async def drop(self: AsyncGridFSBucket, *args: Any, **kwargs: Any) -> None: name = spec["id"] thread = SpecRunnerTask(name) await thread.start() + self.test.addAsyncCleanup(thread.join, 5) self[name] = thread return diff --git a/test/unified_format.py b/test/unified_format.py index 8ed9e214bb..293fbd97ca 100644 --- a/test/unified_format.py +++ b/test/unified_format.py @@ -383,6 +383,7 @@ def drop(self: GridFSBucket, *args: Any, **kwargs: Any) -> None: name = spec["id"] thread = SpecRunnerThread(name) thread.start() + self.test.addCleanup(thread.join, 5) self[name] = thread return