Skip to content

Commit

Permalink
Make failure to increase the recv buffer size non-fatal
Browse files Browse the repository at this point in the history
We now try to set the buffer to
2097152, 1048576, 524288, 262144, 131072

before giving up and logging a warning
  • Loading branch information
bdraco committed Dec 19, 2023
1 parent 47860f4 commit f8728c7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@ def _setsockopt(*args, **kwargs):
assert "Unable to increase the socket receive buffer size to 131072" in caplog.text
assert tried_sizes == [2097152, 1048576, 524288, 262144, 131072]

# Failure to increase the buffer size should not cause the connection to fail
assert conn.is_connected


@pytest.mark.asyncio
async def test_start_connection_can_only_increase_buffer_size_to_262144(
Expand Down Expand Up @@ -327,6 +330,9 @@ def _setsockopt(*args, **kwargs):
assert "Unable to increase the socket receive buffer size" not in caplog.text
assert tried_sizes == [2097152, 1048576, 524288, 262144]

# Failure to increase the buffer size should not cause the connection to fail
assert conn.is_connected


@pytest.mark.asyncio
async def test_start_connection_times_out(
Expand Down

0 comments on commit f8728c7

Please sign in to comment.