test_the_split_counts_mutexes_and_not_rows¶
Tests › tests/test_roster_origin_split.py
What this test is for
Why it exists
THE CONTROL THAT SEPARATES THE TWO PLAUSIBLE IMPLEMENTATIONS. `locks` is keyed UNIQUE(name, scope, kind), so one `std::shared_mutex` taken with a `lock_guard` and a `shared_lock` occupies TWO rows for ONE mutex. Splitting rows would report `external: 2` here — arithmetically consistent, and an answer to a question nobody asked.
Given
- —
When
inv = q.lock_roster( _lock_db( tmp_path, [ (1, "ggml_mutex", "class:Backend", "shared_mutex", 2), (2, "ggml_mutex", "class:Backend", "mutex", 2), ], _MIXED_FILES, ) )
Then
- ✓ inv.rows equals 2
- ✓ inv.distinct_mutexes equals 1
- ✓ inv.origin.total equals 1
- ✓ inv.origin.external equals 1
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) · 14 of 400 steps
… 215 earlier steps
… 125 steps between
… 38 later steps
2 more
- `main` (scripts/export_parity.py) · 14 of 203 steps
- Look up one name: everything the index holds about it · 1 of 226 steps
tests/test_roster_origin_split.py:149 · its file's page
What it checks (3)
assert inv.rows == 2, "two identities"observeslock_rosterviainvassert inv.distinct_mutexes == 1, "one physical mutex"observeslock_rosterviainvassert inv.origin.total == 1 and inv.origin.external == 1, ( "the split is over mutexes; counting rows would say external: 2 for one mutex" )observeslock_rosterviainv
Where the product reaches it
main→query_main→_payload→export_search→corpus_payload→lock_roster(flow)
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-QUERY-011 measured
- REQ-DDB-SCHEMA-011 measured