Skip to content

Commit dde4988

Browse files
author
mingsing
committed
fix async health check
Signed-off-by: mingsing <[email protected]>
1 parent d9cfc36 commit dde4988

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

dapr/aio/clients/grpc/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1912,7 +1912,7 @@ async def wait(self, timeout_s: float):
19121912
remaining = (start + timeout_s) - time.time()
19131913
if remaining < 0:
19141914
raise e
1915-
asyncio.sleep(min(1, remaining))
1915+
await asyncio.sleep(min(1, remaining))
19161916

19171917
async def get_metadata(self) -> GetMetadataResponse:
19181918
"""Returns information about the sidecar allowing for runtime

tests/clients/test_dapr_grpc_client_async_secure.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@
1818
from unittest.mock import patch
1919

2020
from dapr.aio.clients.grpc.client import DaprGrpcClientAsync
21-
from dapr.clients.health import DaprHealth
21+
from dapr.aio.clients.health import DaprHealth as DaprHealthAsync
22+
from dapr.clients.health import DaprHealth as DaprHealth
2223
from tests.clients.certs import replacement_get_credentials_func, replacement_get_health_context
2324
from tests.clients.test_dapr_grpc_client_async import DaprGrpcClientAsyncTests
2425
from .fake_dapr_server import FakeDaprSidecar
2526
from dapr.conf import settings
2627

2728

2829
DaprGrpcClientAsync.get_credentials = replacement_get_credentials_func
30+
DaprHealthAsync.get_ssl_context = replacement_get_health_context
2931
DaprHealth.get_ssl_context = replacement_get_health_context
3032

3133

0 commit comments

Comments
 (0)