File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change
1
+ Downgraded the logging level for connector close errors from ERROR to DEBUG, as these are expected behavior with TLS 1.3 connections -- by :user: `bdraco `.
Original file line number Diff line number Diff line change 1
1
import asyncio
2
2
import functools
3
- import logging
4
3
import random
5
4
import socket
6
5
import sys
60
59
set_exception ,
61
60
set_result ,
62
61
)
62
+ from .log import client_logger
63
63
from .resolver import DefaultResolver
64
64
65
65
if sys .version_info >= (3 , 12 ):
@@ -137,7 +137,7 @@ async def _wait_for_close(waiters: List[Awaitable[object]]) -> None:
137
137
results = await asyncio .gather (* waiters , return_exceptions = True )
138
138
for res in results :
139
139
if isinstance (res , Exception ):
140
- logging . error ("Error while closing connector: %r" , res )
140
+ client_logger . debug ("Error while closing connector: %r" , res )
141
141
142
142
143
143
class Connection :
Original file line number Diff line number Diff line change 2
2
import asyncio
3
3
import gc
4
4
import hashlib
5
+ import logging
5
6
import platform
6
7
import socket
7
8
import ssl
@@ -309,6 +310,7 @@ async def test_close_with_exception_during_closing(
309
310
loop : asyncio .AbstractEventLoop , caplog : pytest .LogCaptureFixture
310
311
) -> None :
311
312
"""Test that exceptions during connection closing are logged."""
313
+ caplog .set_level (logging .DEBUG )
312
314
proto = create_mocked_conn ()
313
315
314
316
# Make the closed future raise an exception when awaited
@@ -327,7 +329,7 @@ async def test_close_with_exception_during_closing(
327
329
328
330
# Check that the error was logged
329
331
assert len (caplog .records ) == 1
330
- assert caplog .records [0 ].levelname == "ERROR "
332
+ assert caplog .records [0 ].levelname == "DEBUG "
331
333
assert "Error while closing connector" in caplog .records [0 ].message
332
334
assert "RuntimeError('Connection close failed')" in caplog .records [0 ].message
333
335
You can’t perform that action at this time.
0 commit comments