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