core/tests/components/websocket_api
J. Nick Koston 79bc179ce8
Improve websocket message coalescing to handle thundering herds better (#118268)
* Increase websocket peak messages to match max expected entities

During startup the websocket would frequently disconnect if more than
4096 entities were added back to back. Some MQTT setups will have more
than 10000 entities. Match the websocket peak value to the max expected
entities

* coalesce more

* delay more if the backlog gets large

* wait to send if the queue is building rapidly

* tweak

* tweak for chrome since it works great in firefox but chrome cannot handle it

* Revert "tweak for chrome since it works great in firefox but chrome cannot handle it"

This reverts commit 439e2d76b1.

* adjust for chrome

* lower number

* remove code

* fixes

* fast path for bytes

* compact

* adjust test since we see the close right away now on overload

* simplify check

* reduce loop

* tweak

* handle ready right away
2024-05-28 23:14:06 -04:00
..
__init__.py
conftest.py
test_auth.py Bump aiohttp to 3.9.4 (#110730) 2024-04-11 11:58:56 -10:00
test_commands.py Translate service validation errors (#115024) 2024-04-18 14:36:03 +02:00
test_connection.py
test_decorators.py Skip processing websocket_api schema if it has no arguments (#115618) 2024-04-18 10:41:08 -04:00
test_http.py Improve websocket message coalescing to handle thundering herds better (#118268) 2024-05-28 23:14:06 -04:00
test_init.py Bump aiohttp to 3.9.4 (#110730) 2024-04-11 11:58:56 -10:00
test_messages.py Avoid re-encoding the message id as bytes for every event/state change (#116460) 2024-04-30 12:02:28 -05:00
test_sensor.py