fix: quic maddr test

This commit is contained in:
Akash Mondal
2025-08-14 19:47:47 +00:00
committed by lla-dane
parent 6d1e53a4e2
commit 760f94bd81
2 changed files with 5 additions and 2 deletions

View File

@ -199,9 +199,10 @@ def new_swarm(
transport = TCP()
else:
addr = listen_addrs[0]
is_quic = addr.__contains__("quic") or addr.__contains__("quic-v1")
if addr.__contains__("tcp"):
transport = TCP()
elif addr.__contains__("quic"):
elif is_quic:
transport_opt = transport_opt or {}
quic_config = transport_opt.get('quic_config', QUICTransportConfig())
transport = QUICTransport(key_pair.private_key, quic_config)

View File

@ -365,6 +365,7 @@ async def test_yamux_stress_ping():
await client_host.connect(info)
async def ping_stream(i: int):
stream = None
try:
start = trio.current_time()
stream = await client_host.new_stream(
@ -384,7 +385,8 @@ async def test_yamux_stress_ping():
except Exception as e:
print(f"[Ping #{i}] Failed: {e}")
failures.append(i)
await stream.reset()
if stream:
await stream.reset()
async with trio.open_nursery() as nursery:
for i in range(STREAM_COUNT):