test_an_unresolved_extent_carries_no_calls_through_to_R2

Tests › tests/test_critical_sections.py

passed Passed in the packaged run.

What this test is for

Why it exists

The fail-closed rule has to survive the query layer too: a section whose extent is NULL must arrive with an empty `calls`, so a consumer cannot read a partial membership as a complete one.

Given

  1. conn = _query_db()
  2. conn.execute( "INSERT INTO lock_acquisitions " "(id, lock_id, holder_rowid, path_rowid, form, role, mode, start_line, end_line, " " pattern_name, declared, confidence) " "VALUES (3, 1, 3, 1, 'call', 'acquire', 'exclusive', 60, NULL, " "'pthread_mutex_lock', 0, 'low')" )
→

When

  1. section = next(s for s in sections_in(conn, "audit") if s.start_line == 60)
→

Then

  1. ✓ section.end_line is None
  2. ✓ section.calls equals ()
  3. ✓ section.confidence equals EXTENT_UNRESOLVED

What it exercises

The parts of the system's flows this test ran, measured by per-test coverage: lit steps ran in this test, dimmed ones did not, and ▶ marks where the test called in. Each title opens the whole flow with these steps lit.

clew — `main` (clew/cli.py) · 1 of 400 steps

… 352 earlier steps

command-line usercommand-line usercommand-line usercommand-line userclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyother filesother filesother filesother filesmain353–354. lock_roster → nestings_on353nestings_on +1 more355. _layer_present → table_exists355table_exists▶ test enters356. nestings_on → table_exists356table_exists357. lock_roster → _nesting_pairs357_nesting_pairs

… 43 later steps

1 more

tests/test_critical_sections.py:679 · its file's page

What it checks (3)

  1. assert section.end_line is None observes sections_in via section
  2. assert section.calls == () observes sections_in via section
  3. assert section.confidence == EXTENT_UNRESOLVED observes sections_in via section

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_an_unresolved_extent_carries_no_calls_through_to_R2→_query_db→sections_in

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.

test_an_unresolved_extent_carries_no_calls_through_to_R2 · 3 checkssections_inconnectREQ-DDB-QUERY-001 · measuredsections_inrowids_for_nameREQ-DDB-QUERY-003 · measuredsections_inREQ-DDB-SCHEMA-011 · measured
Also reaches 4 requirements

Its run touches their code; that is reach, not proof.