Block detectable I/O in the event loop (#48387)
We added a warning when this happens last April and gave developers a year to fix the instability. We now prevent the instability by raising RuntimeError when code attempts to do known I/O in the event loop instead of the executor. We now provide a suggestion on how to fix the code that is causing the issue.
This commit is contained in:
parent
63e3012380
commit
b50dcef94f
2 changed files with 6 additions and 2 deletions
|
@ -78,7 +78,7 @@ async def test_check_loop_async():
|
|||
|
||||
async def test_check_loop_async_integration(caplog):
|
||||
"""Test check_loop detects when called from event loop from integration context."""
|
||||
with patch(
|
||||
with pytest.raises(RuntimeError), patch(
|
||||
"homeassistant.util.async_.extract_stack",
|
||||
return_value=[
|
||||
Mock(
|
||||
|
@ -107,7 +107,7 @@ async def test_check_loop_async_integration(caplog):
|
|||
|
||||
async def test_check_loop_async_custom(caplog):
|
||||
"""Test check_loop detects when called from event loop with custom component context."""
|
||||
with patch(
|
||||
with pytest.raises(RuntimeError), patch(
|
||||
"homeassistant.util.async_.extract_stack",
|
||||
return_value=[
|
||||
Mock(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue