mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
fix: quic maddr test
This commit is contained in:
@ -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)
|
||||
|
||||
@ -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):
|
||||
|
||||
Reference in New Issue
Block a user