test_a_successful_build_reclaims_a_mostly_free_cache¶
Tests › tests/test_indexcache_vacuum.py
What this test is for
Why it exists
A commit over a mostly-free cache reclaims the space.
Given
repo = tmp_path / "repo"repo.mkdir()
5 more
path = tmp_path / "clew.db.idxcache"cache = IndexCache(path, repo)_churn(cache)cache.commit()cache.close()
When
- —
Then
- ✓ _free_ratio(path) is greater than VACUUM_FREE_RATIO
- ✓ _free_ratio(path) is at most VACUUM_FREE_RATIO
tests/test_indexcache_vacuum.py:54 · its file's page
What it checks (2)
assert _free_ratio(path) > VACUUM_FREE_RATIO, "fixture did not create free pages"observes_free_ratioassert _free_ratio(path) <= VACUUM_FREE_RATIOobserves_free_ratio
Where the product reaches it
No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.
Call flow
test_a_successful_build_reclaims_a_mostly_free_cache→_churn→_free_ratioWhat it reaches
Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.
Also reaches 1 requirement
Its run touches their code; that is reach, not proof.
- REQ-DDB-INDEX-002 measured