From f3363b0e4a099eac2d0e85a5689f19b59dc89dbd Mon Sep 17 00:00:00 2001 From: Noah Stapp Date: Tue, 15 Oct 2024 15:14:54 -0400 Subject: [PATCH] PYTHON-4871 - Fix async waitForEvent --- test/asynchronous/unified_format.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/asynchronous/unified_format.py b/test/asynchronous/unified_format.py index 42bda59cb2..2ff38f06e9 100644 --- a/test/asynchronous/unified_format.py +++ b/test/asynchronous/unified_format.py @@ -50,6 +50,7 @@ ) from test.utils import ( async_get_pool, + async_wait_until, camel_to_snake, camel_to_snake_args, parse_spec_options, @@ -1144,13 +1145,13 @@ def _testOperation_assertEventCount(self, spec): client, event, count = spec["client"], spec["event"], spec["count"] self.assertEqual(self._event_count(client, event), count, f"expected {count} not {event!r}") - def _testOperation_waitForEvent(self, spec): + async def _testOperation_waitForEvent(self, spec): """Run the waitForEvent test operation. Wait for a number of events to be published, or fail. """ client, event, count = spec["client"], spec["event"], spec["count"] - wait_until( + await async_wait_until( lambda: self._event_count(client, event) >= count, f"find {count} {event} event(s)", )