Skip to content

Commit 66f1915

Browse files
author
Andrei Neagu
committed
enhanced waiting for progress to be delivered
1 parent e5dc682 commit 66f1915

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

services/dynamic-sidecar/tests/unit/test_api_rest_containers_long_running_tasks.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# pylint: disable=unused-argument
33
# pylint: disable=no-member
44

5+
import asyncio
56
import json
67
from collections.abc import AsyncIterable, AsyncIterator, Awaitable, Callable, Iterator
78
from contextlib import asynccontextmanager, contextmanager
@@ -394,12 +395,13 @@ async def _assert_progress_finished(
394395
last_progress_message: tuple[ProgressMessage, ProgressPercent] | None,
395396
) -> None:
396397
async for attempt in AsyncRetrying(
397-
stop=stop_after_delay(5),
398+
stop=stop_after_delay(10),
398399
wait=wait_fixed(0.1),
399400
retry=retry_if_exception_type(AssertionError),
400401
reraise=True,
401402
):
402403
with attempt:
404+
await asyncio.sleep(0) # yield control to the event loop
403405
assert last_progress_message == ("finished", 1.0)
404406

405407

0 commit comments

Comments
 (0)