test_lock_nestings_reports_the_cross_function_two_lock_holding¶
Tests › tests/test_critical_sections.py
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
- —
When
nestings = lock_nestings(_query_db())
Then
- ✓ len(nestings) equals 1
- ✓ (nestings[0].outer_scope, nestings[0].inner_scope) equals ("class:Owner", "class:Queue")
- ✓ (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
… 42 later steps
1 more
- `main` (scripts/export_parity.py) · 3 of 203 steps
tests/test_critical_sections.py:529 · its file's page
What it checks (3)
assert len(nestings) == 1observeslock_nestingsvianestingsassert (nestings[0].outer_scope, nestings[0].inner_scope) == ("class:Owner", "class:Queue")observeslock_nestingsvianestingsassert (nestings[0].via, nestings[0].holder, nestings[0].line) == ("enqueue", "writer", 12)observeslock_nestingsvianestings
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
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 4 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-QUERY-001 measured
- REQ-DDB-QUERY-003 measured
- REQ-DDB-SCHEMA-011 measured
- REQ-DDB-SCHEMA-012 measured