Skip to content

Commit df8636a

Browse files
author
Andrei Neagu
committed
fixed hanging test
1 parent a9befe4 commit df8636a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/service-library/tests/conftest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
# pylint: disable=unused-argument
44
# pylint: disable=unused-import
55

6+
import asyncio
67
import sys
78
from collections.abc import AsyncIterable, AsyncIterator, Callable
8-
from contextlib import AbstractAsyncContextManager, asynccontextmanager
9+
from contextlib import AbstractAsyncContextManager, asynccontextmanager, suppress
910
from copy import deepcopy
1011
from pathlib import Path
1112
from typing import Any
@@ -91,7 +92,8 @@ async def _(
9192

9293
yield client
9394

94-
await client.shutdown()
95+
with suppress(TimeoutError):
96+
await asyncio.wait_for(client.shutdown(), timeout=5.0)
9597

9698
async def _cleanup_redis_data(clients_manager: RedisClientsManager) -> None:
9799
for db in RedisDatabase:

0 commit comments

Comments
 (0)