Make failure to increase the recv buffer size non-fatal

We now try to set the buffer to
2097152, 1048576, 524288, 262144, 131072

before giving up and logging a warning
This commit is contained in:
J. Nick Koston 2023-12-19 09:49:41 -10:00
parent 47860f455b
commit f8728c7cbc
No known key found for this signature in database
1 changed files with 6 additions and 0 deletions

View File

@ -281,6 +281,9 @@ async def test_start_connection_cannot_increase_recv_buffer(
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(
@ -327,6 +330,9 @@ async def test_start_connection_can_only_increase_buffer_size_to_262144(
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(