test_a_flush_alone_does_not_vacuum

Tests › tests/test_indexcache_vacuum.py

passed Passed in the packaged run.

What this test is for

Why it exists

THE SUCCESS PATH ONLY. A VACUUM rewrites the whole file; an aborted build that paid for one would pay it on every retry, which is the cost the cache exists to avoid.

Given

  1. repo = tmp_path / "repo"
  2. repo.mkdir()
4 more
  1. path = tmp_path / "clew.db.idxcache"
  2. cache = IndexCache(path, repo)
  3. _churn(cache)
  4. cache.close()
→

When

  1. —
→

Then

  1. ✓ _free_ratio(path) is greater than VACUUM_FREE_RATIO

tests/test_indexcache_vacuum.py:74 · its file's page

What it checks (1)

  1. assert _free_ratio(path) > VACUUM_FREE_RATIO observes _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_flush_alone_does_not_vacuum→_churn→_free_ratio

What 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.