Skip to content

Commit

Permalink
test with 0 reping interval
Browse files Browse the repository at this point in the history
  • Loading branch information
pedohorse committed Oct 29, 2024
1 parent 725c420 commit 218916d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tests/tests_net_messages/test_connection_pool_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,22 @@ def _create_protocol():
while srv is None:
await asyncio.sleep(0.1)

stream_stash = []
timeout = 2
pooled_factory = TcpMessageStreamPooledFactory(
timeout,
_fake_conn_opener_factory(stream_stash, _initialize_connection),
timeout=5,
minimal_reping_interval=0,
)

try:
stream_stash = []
timeout = 2
pooled_factory = TcpMessageStreamPooledFactory(timeout, _fake_conn_opener_factory(stream_stash, _initialize_connection), timeout=5)

addr = DirectAddress(f'{get_localhost()}:29361'), DirectAddress(f'{get_localhost()}:29360')

print('attempting connection')
for _ in range(3):
print('sending message')
stream0 = await pooled_factory.open_sending_stream(*addr)
stream0.close()
await stream0.wait_closed()
Expand All @@ -141,6 +148,7 @@ def _create_protocol():
await prt.last_writer.wait_closed()

for _ in range(3):
print('sending message')
stream0 = await pooled_factory.open_sending_stream(*addr)
await stream0.send_data_message(b'foo', addr[0], session=uuid.uuid4())
stream0.close()
Expand Down

0 comments on commit 218916d

Please sign in to comment.