Skip to content

Commit

Permalink
Fix flaky test in history stats (#131869)
Browse files Browse the repository at this point in the history
  • Loading branch information
karwosts authored and frenck committed Nov 28, 2024
1 parent 2ea0c54 commit ee96093
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/components/history_stats/test_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,11 @@ async def test_async_on_entire_period(
def _fake_states(*args, **kwargs):
return {
"binary_sensor.test_on_id": [
ha.State("binary_sensor.test_on_id", "on", last_changed=start_time),
ha.State(
"binary_sensor.test_on_id",
"on",
last_changed=(start_time - timedelta(seconds=10)),
),
ha.State("binary_sensor.test_on_id", "on", last_changed=t0),
ha.State("binary_sensor.test_on_id", "on", last_changed=t1),
ha.State("binary_sensor.test_on_id", "on", last_changed=t2),
Expand Down

0 comments on commit ee96093

Please sign in to comment.