Fix flakiness of test_measure_sliding_window (#115322)
This commit is contained in:
parent
2fdb420d1a
commit
0636ba340c
1 changed files with 46 additions and 47 deletions
|
@ -1175,6 +1175,13 @@ async def test_measure_sliding_window(
|
|||
]
|
||||
}
|
||||
|
||||
with (
|
||||
patch(
|
||||
"homeassistant.components.recorder.history.state_changes_during_period",
|
||||
_fake_states,
|
||||
),
|
||||
freeze_time(start_time),
|
||||
):
|
||||
await async_setup_component(
|
||||
hass,
|
||||
"sensor",
|
||||
|
@ -1221,14 +1228,6 @@ async def test_measure_sliding_window(
|
|||
},
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
with (
|
||||
patch(
|
||||
"homeassistant.components.recorder.history.state_changes_during_period",
|
||||
_fake_states,
|
||||
),
|
||||
freeze_time(start_time),
|
||||
):
|
||||
for i in range(1, 5):
|
||||
await async_update_entity(hass, f"sensor.sensor{i}")
|
||||
await hass.async_block_till_done()
|
||||
|
|
Loading…
Add table
Reference in a new issue