mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Reduce number of test states in big purge test to fix CI (#102401)
This commit is contained in:
parent
0bd416e53d
commit
27b5a9e074
@ -74,16 +74,16 @@ async def test_purge_big_database(
|
|||||||
|
|
||||||
instance = await async_setup_recorder_instance(hass)
|
instance = await async_setup_recorder_instance(hass)
|
||||||
|
|
||||||
for _ in range(25):
|
for _ in range(12):
|
||||||
await _add_test_states(hass, wait_recording_done=False)
|
await _add_test_states(hass, wait_recording_done=False)
|
||||||
await async_wait_recording_done(hass)
|
await async_wait_recording_done(hass)
|
||||||
|
|
||||||
with patch.object(instance, "max_bind_vars", 100), patch.object(
|
with patch.object(instance, "max_bind_vars", 72), patch.object(
|
||||||
instance.database_engine, "max_bind_vars", 100
|
instance.database_engine, "max_bind_vars", 72
|
||||||
), session_scope(hass=hass) as session:
|
), session_scope(hass=hass) as session:
|
||||||
states = session.query(States)
|
states = session.query(States)
|
||||||
state_attributes = session.query(StateAttributes)
|
state_attributes = session.query(StateAttributes)
|
||||||
assert states.count() == 150
|
assert states.count() == 72
|
||||||
assert state_attributes.count() == 3
|
assert state_attributes.count() == 3
|
||||||
|
|
||||||
purge_before = dt_util.utcnow() - timedelta(days=4)
|
purge_before = dt_util.utcnow() - timedelta(days=4)
|
||||||
@ -96,7 +96,7 @@ async def test_purge_big_database(
|
|||||||
repack=False,
|
repack=False,
|
||||||
)
|
)
|
||||||
assert not finished
|
assert not finished
|
||||||
assert states.count() == 50
|
assert states.count() == 24
|
||||||
assert state_attributes.count() == 1
|
assert state_attributes.count() == 1
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user