mirror of
https://github.com/esphome/aioesphomeapi.git
synced 2024-09-28 04:27:27 +02:00
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:
parent
47860f455b
commit
f8728c7cbc
@ -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 "Unable to increase the socket receive buffer size to 131072" in caplog.text
|
||||||
assert tried_sizes == [2097152, 1048576, 524288, 262144, 131072]
|
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
|
@pytest.mark.asyncio
|
||||||
async def test_start_connection_can_only_increase_buffer_size_to_262144(
|
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 "Unable to increase the socket receive buffer size" not in caplog.text
|
||||||
assert tried_sizes == [2097152, 1048576, 524288, 262144]
|
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
|
@pytest.mark.asyncio
|
||||||
async def test_start_connection_times_out(
|
async def test_start_connection_times_out(
|
||||||
|
Loading…
Reference in New Issue
Block a user