test_a_successful_build_reclaims_a_mostly_free_cache

Tests › tests/test_indexcache_vacuum.py

passed Passed in the packaged run.

What this test is for

Why it exists

A commit over a mostly-free cache reclaims the space.

Given

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

When

  1. —
→

Then

  1. ✓ _free_ratio(path) is greater than VACUUM_FREE_RATIO
  2. ✓ _free_ratio(path) is at most VACUUM_FREE_RATIO

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

What it checks (2)

  1. assert _free_ratio(path) > VACUUM_FREE_RATIO, "fixture did not create free pages" observes _free_ratio
  2. 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_successful_build_reclaims_a_mostly_free_cache→_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.