mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Smaller timeout for MongoStorage connection in tests
The default 30s timeout is too long
This commit is contained in:
parent
03c0d58290
commit
fefbd45625
1 changed files with 4 additions and 1 deletions
|
|
@ -82,7 +82,10 @@ async def mongo_storage(mongo_server):
|
|||
parse_mongo_url(mongo_server)
|
||||
except InvalidURI as e:
|
||||
raise UsageError(invalid_uri_pattern.format(db="mongo", uri=mongo_server, err=e))
|
||||
storage = MongoStorage.from_url(mongo_server)
|
||||
storage = MongoStorage.from_url(
|
||||
url=mongo_server,
|
||||
connection_kwargs={"serverSelectionTimeoutMS": 2000},
|
||||
)
|
||||
try:
|
||||
await storage._client.server_info()
|
||||
except PyMongoError as e:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue