Reduce number of test states in big purge test to fix CI (#102401)

This commit is contained in:
J. Nick Koston 2023-10-20 08:09:59 -10:00 committed by GitHub
parent 0bd416e53d
commit 27b5a9e074
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,16 +74,16 @@ async def test_purge_big_database(
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 async_wait_recording_done(hass)
with patch.object(instance, "max_bind_vars", 100), patch.object(
instance.database_engine, "max_bind_vars", 100
with patch.object(instance, "max_bind_vars", 72), patch.object(
instance.database_engine, "max_bind_vars", 72
), session_scope(hass=hass) as session:
states = session.query(States)
state_attributes = session.query(StateAttributes)
assert states.count() == 150
assert states.count() == 72
assert state_attributes.count() == 3
purge_before = dt_util.utcnow() - timedelta(days=4)
@ -96,7 +96,7 @@ async def test_purge_big_database(
repack=False,
)
assert not finished
assert states.count() == 50
assert states.count() == 24
assert state_attributes.count() == 1