From 3970dc1dd3fced5df6c245211acde4a8e3a7c8ca Mon Sep 17 00:00:00 2001 From: Iris Date: Wed, 4 Sep 2024 15:12:07 -0700 Subject: [PATCH 1/3] fix: Failing Async Bulk Tests --- test/asynchronous/test_bulk.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/asynchronous/test_bulk.py b/test/asynchronous/test_bulk.py index 24111ad7c0..af615ed0b5 100644 --- a/test/asynchronous/test_bulk.py +++ b/test/asynchronous/test_bulk.py @@ -919,7 +919,7 @@ async def test_readonly(self): username="readonly", password="pw", authSource="pymongo_test" ) coll = cli.pymongo_test.test - coll.find_one() + await coll.find_one() with self.assertRaises(OperationFailure): await coll.bulk_write([InsertOne({"x": 1})]) @@ -930,7 +930,7 @@ async def test_no_remove(self): username="noremove", password="pw", authSource="pymongo_test" ) coll = cli.pymongo_test.test - coll.find_one() + await coll.find_one() requests = [ InsertOne({"x": 1}), ReplaceOne({"x": 2}, {"x": 2}, upsert=True), From f57129043721b0a7addd40ebb67538e03fa627c4 Mon Sep 17 00:00:00 2001 From: Iris Date: Wed, 4 Sep 2024 16:03:14 -0700 Subject: [PATCH 2/3] fix: Failing Async Bulk Tests pt2 --- test/asynchronous/test_bulk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/asynchronous/test_bulk.py b/test/asynchronous/test_bulk.py index af615ed0b5..f710e92f34 100644 --- a/test/asynchronous/test_bulk.py +++ b/test/asynchronous/test_bulk.py @@ -817,7 +817,7 @@ async def asyncSetUp(self): roles=[], ) - async_client_context.create_user(self.db.name, "noremove", "pw", ["noremove"]) + await async_client_context.create_user(self.db.name, "noremove", "pw", ["noremove"]) async def asyncTearDown(self): await self.db.command("dropRole", "noremove") From 74dcd9fc504a83f31a7070edeef6480838f1b9e8 Mon Sep 17 00:00:00 2001 From: Iris Date: Wed, 4 Sep 2024 17:03:38 -0700 Subject: [PATCH 3/3] fix: Failing Async Bulk Tests pt3 --- test/asynchronous/test_bulk.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/asynchronous/test_bulk.py b/test/asynchronous/test_bulk.py index f710e92f34..b5f2eefdef 100644 --- a/test/asynchronous/test_bulk.py +++ b/test/asynchronous/test_bulk.py @@ -26,8 +26,8 @@ from test.asynchronous import AsyncIntegrationTest, async_client_context, remove_all_users, unittest from test.utils import ( async_rs_or_single_client_noauth, + async_single_client, async_wait_until, - single_client, ) from bson.binary import Binary, UuidRepresentation @@ -954,7 +954,7 @@ async def _setup_class(cls): if cls.w is not None and cls.w > 1: for member in (await async_client_context.hello)["hosts"]: if member != (await async_client_context.hello)["primary"]: - cls.secondary = single_client(*partition_node(member)) + cls.secondary = await async_single_client(*partition_node(member)) break @classmethod