test_lock_nestings_reports_the_cross_function_two_lock_holding

Tests › tests/test_critical_sections.py

passed Passed in the packaged run.

What this test is for

Why it exists

The measurement L1 recorded as impossible. Within a function both real codebases showed ZERO simultaneous holdings; the real ones span a call. Reported as an ORDERED pair, because the order — not the fact of nesting — is what a deadlock check compares between sites.

Given

  1. —
→

When

  1. nestings = lock_nestings(_query_db())
→

Then

  1. ✓ len(nestings) equals 1
  2. ✓ (nestings[0].outer_scope, nestings[0].inner_scope) equals ("class:Owner", "class:Queue")
  3. ✓ (nestings[0].via, nestings[0].holder, nestings[0].line) equals ("enqueue", "writer", 12)

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) · 3 of 400 steps

… 351 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 filesmain352. _roster_sql → has_columns352has_columns353. lock_roster → nestings_on353nestings_on354. nestings_on → _layer_present354_layer_present▶ test enters355. _layer_present → table_exists355table_exists356. nestings_on → table_exists356table_exists357–358. lock_roster → _nesting_pairs357_nesting_pairs +1 more

… 42 later steps

1 more

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

What it checks (3)

  1. assert len(nestings) == 1 observes lock_nestings via nestings
  2. assert (nestings[0].outer_scope, nestings[0].inner_scope) == ("class:Owner", "class:Queue") observes lock_nestings via nestings
  3. assert (nestings[0].via, nestings[0].holder, nestings[0].line) == ("enqueue", "writer", 12) observes lock_nestings via nestings

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_lock_nestings_reports_the_cross_function_two_lock_holding→lock_nestings→_query_db

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_lock_nestings_reports_the_cross_function_two_lock_holding · 3 checkslock_nestingsconnectREQ-DDB-QUERY-001 · measuredlock_nestingsnestings_ontable_existsREQ-DDB-QUERY-003 · measuredlock_nestingsREQ-DDB-SCHEMA-011 · measured
Also reaches 4 requirements

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