test_the_split_counts_mutexes_and_not_rows

Tests › tests/test_roster_origin_split.py

passed Passed in the packaged run.

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

  1. —
→

When

  1. 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

  1. ✓ inv.rows equals 2
  2. ✓ inv.distinct_mutexes equals 1
  3. ✓ inv.origin.total equals 1
  4. ✓ 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

command-line usercommand-line usercommand-line usercommand-line userclew/query/symbols.pyclew/query/symbols.pyclew/query/symbols.pyclew/query/symbols.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyloop (line 1576)loopmain216. _memberdef_corpora → _expansion_sql216_expansion_sql217. _expansion_sql → has_columns217has_columns218. has_columns → table_exists218table_exists219. _memberdef_corpora → _memberdef_candidates219_memberdef_candidates220. _memberdef_candidates → table_exists220table_exists

… 125 steps between

command-line usercommand-line usercommand-line usercommand-line userclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyother filesother filesother filesother filesloop ×2 (line 555)loop ×2main346. _files_corpus → files_miss346files_miss347. corpus_payload → lock_roster347lock_roster348. lock_roster → connect348connect▶ test enters349. lock_roster → table_exists349table_exists350–351. lock_roster → _entries350_entries +1 more352. _roster_sql → has_columns352has_columns353–354. lock_roster → nestings_on353nestings_on +1 more355. _layer_present → table_exists355table_exists356. nestings_on → table_exists356table_exists357–360. lock_roster → _nesting_pairs357_nesting_pairs +3 more361–362. corpus_payload → one361one ×2

… 38 later steps

2 more

tests/test_roster_origin_split.py:149 · its file's page

What it checks (3)

  1. assert inv.rows == 2, "two identities" observes lock_roster via inv
  2. assert inv.distinct_mutexes == 1, "one physical mutex" observes lock_roster via inv
  3. assert inv.origin.total == 1 and inv.origin.external == 1, ( "the split is over mutexes; counting rows would say external: 2 for one mutex" ) observes lock_roster via inv

Where the product reaches it

  • main → query_main → _payload → export_search → corpus_payload → lock_roster (flow)

Call flow

test_the_split_counts_mutexes_and_not_rows→lock_roster→_lock_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_the_split_counts_mutexes_and_not_rows · 3 checkslock_rosterREQ-DDB-QUERY-001 · measuredlock_rostertable_existsREQ-DDB-QUERY-003 · measuredlock_rosterREQ-DDB-QUERY-011 · measuredlock_rosternestings_onREQ-DDB-SCHEMA-011 · measured
Also reaches 4 requirements

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