test_thread_lifecycle.py¶
tests/test_thread_lifecycle.py
Thread lifecycle: whether a spawned thread is joined, detached or a daemon, and where (2.1).
test_a_chained_end_reports_the_line_of_the_end_not_the_spawn
None test_thread_lifecycle.test_a_chained_end_reports_the_line_of_the_end_not_the_spawn()
The chained `.detach()` line.
tests/test_thread_lifecycle.py:144
Checks
assert spawn is not Noneassert Lifecycles(tree.root_node, src).of(spawn, "std::thread", "", "pthread") == ("detached", 4, )
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-SCHEMA-001 | measured |
Source · 23 lines
def test_a_chained_end_reports_the_line_of_the_end_not_the_spawn() -> None:
"""FOUND MEASURING entropic: a lambda spawn spanning lines 1158-1222 reported 1158, where the
call starts, when the `.detach()` the rubric names is at 1222.
@brief The chained `.detach()` line.
"""
from clew.threadlife import Lifecycles
from clew.tsnode import Parser
src = b"void f() {\n std::thread([]() {\n work();\n }).detach();\n}\n"
tree = Parser("cpp").parse(src)
stack, spawn = [tree.root_node], None
while stack:
node = stack.pop()
stack.extend(node.children)
fn = node.child_by_field_name("function") if node.type == "call_expression" else None
if fn is not None and src[fn.start_byte : fn.end_byte] == b"std::thread":
spawn = node
assert spawn is not None
assert Lifecycles(tree.root_node, src).of(spawn, "std::thread", "", "pthread") == (
"detached",
4,
)1 more lines, not shown
Activity · 13 steps
test_a_handler_registration_has_no_lifecycle
None test_thread_lifecycle.test_a_handler_registration_has_no_lifecycle(Path tmp_path)
A signal handler's lifecycle is absent.
tests/test_thread_lifecycle.py:127
Checks
assert _threads(tmp_path)[("s.cpp", 30)] == (None, None)
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CLI-001 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → report_stats |
| REQ-DDB-CLI-002 | inferred | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → _doxygen_or_partial → _doxygen_stage → _run_doxygen_from_args → run_doxygen → doxygen_supports_sqlite3 |
| REQ-DDB-CONFIG-001 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _apply_declared_document → stated_document_meta |
| REQ-DDB-CONFIG-003 | inferred | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_requirements_yaml → _is_flat_req_list |
| REQ-DDB-CONFIG-004 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → resolve_preprocessor |
| REQ-DDB-CONFIG-005 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_kconfig |
| REQ-DDB-CONFIG-006 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _recorded_entry_patterns → recorded_explicit |
| REQ-DDB-CONFIG-007 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → write_build_signature |
| REQ-DDB-CONFIG-009 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _apply_toolchain_exclusions → load_toolchain_config |
| REQ-DDB-GUARD-012 | inferred | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → load_guard_config → read_guard_config → read_requirements_section |
| REQ-DDB-GUARD-019 | inferred | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_python_docstrings → summarize → parse_doxygen_tags |
| REQ-DDB-GUARD-024 | inferred | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_python_docstrings → summarize → apply_autobrief |
| REQ-DDB-INDEX-001 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _verify_extra_input_is_read → effective_file_patterns |
| REQ-DDB-INDEX-002 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → build_lock |
| REQ-DDB-INDEX-003 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → report_index_coverage |
| REQ-DDB-INDEX-004 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → recover_ast_symbols |
| REQ-DDB-INDEX-005 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → stamp_external_provenance |
| REQ-DDB-INDEX-006 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → record_code_text → code_text_rows |
| REQ-DDB-INDEX-007 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → record_owners |
| REQ-DDB-INDEX-008 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_file_licenses |
| REQ-DDB-INDEX-009 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_kerneldoc |
| REQ-DDB-INDEX-010 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_ast_includes |
| REQ-DDB-INDEX-011 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_property_keys |
| REQ-DDB-MCP-001 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _operator_excludes → meta_section |
| REQ-DDB-MCP-004 | measured | |
| REQ-DDB-PIPE-001 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_database |
| REQ-DDB-PIPE-003 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → build_call_edges |
| REQ-DDB-PIPE-004 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → python_entry_seeds |
| REQ-DDB-PIPE-005 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → write_build_signature |
| REQ-DDB-PIPE-006 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → run_rustdoc → _require_nightly_rustdoc → clean_subprocess_env |
| REQ-DDB-PIPE-007 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_kconfig_gates |
| REQ-DDB-PIPE-008 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_file_docs |
| REQ-DDB-PIPE-009 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → prune_dominated_fuzzy_call_edges |
| REQ-DDB-PIPE-010 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_shared_key_edges_inferred → _build_inferred_edges |
| REQ-DDB-PIPE-011 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_ast_includes → run_harvest → _harvest_one_file → _parseable_file |
| REQ-DDB-PIPE-012 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → build_harvest_plan → js_symbol_harvester |
| REQ-DDB-PIPE-013 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_python_docstrings |
| REQ-DDB-PIPE-014 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_kerneldoc → within_repo |
| REQ-DDB-PIPE-015 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_config_defaults |
| REQ-DDB-QUERY-003 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → mark_test_scope |
| REQ-DDB-QUERY-011 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → extract_threads → _ensure_threads_tables |
| REQ-DDB-SCHEMA-001 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → extract_threads |
| REQ-DDB-SCHEMA-002 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_shared_key_edges_inferred → _writer_dispatch_map |
| REQ-DDB-SCHEMA-003 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_callback_registration_edges → _ensure_external_boundaries_table |
| REQ-DDB-SCHEMA-004 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → load_dispatch_manifest |
| REQ-DDB-SCHEMA-005 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → resolve_key_alias_prefixes |
| REQ-DDB-SCHEMA-006 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_requirements_yaml |
| REQ-DDB-SCHEMA-007 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_callback_registration_edges → _ensure_external_boundaries_table |
| REQ-DDB-SCHEMA-009 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_event_edges |
| REQ-DDB-SCHEMA-011 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → extract_context_conflicts |
| REQ-DDB-SCHEMA-012 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → load_dispatch_manifest → declaration_origin |
| REQ-DDB-SCHEMA-013 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_data_model_keys |
| REQ-DDB-SCHEMA-014 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_file_docs → ensure_file_docs_table |
| REQ-DDB-SCHEMA-015 | measured | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_requirements_yaml |
| REQ-DDB-WIKI-054 | inferred | test_a_handler_registration_has_no_lifecycle → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → recover_ast_symbols → _recover_into → all |
Source · 9 lines
def test_a_handler_registration_has_no_lifecycle(tmp_path: Path) -> None:
"""FOUND MEASURING mbedtls: `signal(SIGINT, h)` read `unknown`. No thread is created, so the
question does not apply and the column is NULL, never "we looked and found nothing".
@brief A signal handler's lifecycle is absent.
"""
assert _threads(tmp_path)[("s.cpp", 30)] == (None, None)
Activity · 1 steps
test_a_local_handle_is_ended_only_in_its_own_function
None test_thread_lifecycle.test_a_local_handle_is_ended_only_in_its_own_function(Path tmp_path)
Local handles stay local.
tests/test_thread_lifecycle.py:117
Checks
assert _threads(tmp_path)[("w.py", 21)] == ("unknown", None)
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CLI-001 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → report_stats |
| REQ-DDB-CLI-002 | inferred | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → _doxygen_or_partial → _doxygen_stage → _run_doxygen_from_args → run_doxygen → doxygen_supports_sqlite3 |
| REQ-DDB-CONFIG-001 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _apply_declared_document → stated_document_meta |
| REQ-DDB-CONFIG-003 | inferred | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_requirements_yaml → _is_flat_req_list |
| REQ-DDB-CONFIG-004 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → resolve_preprocessor |
| REQ-DDB-CONFIG-005 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_kconfig |
| REQ-DDB-CONFIG-006 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _recorded_entry_patterns → recorded_explicit |
| REQ-DDB-CONFIG-007 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → write_build_signature |
| REQ-DDB-CONFIG-009 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _apply_toolchain_exclusions → load_toolchain_config |
| REQ-DDB-GUARD-012 | inferred | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → load_guard_config → read_guard_config → read_requirements_section |
| REQ-DDB-GUARD-019 | inferred | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_python_docstrings → summarize → parse_doxygen_tags |
| REQ-DDB-GUARD-024 | inferred | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_python_docstrings → summarize → apply_autobrief |
| REQ-DDB-INDEX-001 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _verify_extra_input_is_read → effective_file_patterns |
| REQ-DDB-INDEX-002 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → build_lock |
| REQ-DDB-INDEX-003 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → report_index_coverage |
| REQ-DDB-INDEX-004 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → recover_ast_symbols |
| REQ-DDB-INDEX-005 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → stamp_external_provenance |
| REQ-DDB-INDEX-006 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → record_code_text → code_text_rows |
| REQ-DDB-INDEX-007 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → record_owners |
| REQ-DDB-INDEX-008 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_file_licenses |
| REQ-DDB-INDEX-009 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_kerneldoc |
| REQ-DDB-INDEX-010 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_ast_includes |
| REQ-DDB-INDEX-011 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_property_keys |
| REQ-DDB-MCP-001 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _operator_excludes → meta_section |
| REQ-DDB-MCP-004 | measured | |
| REQ-DDB-PIPE-001 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_database |
| REQ-DDB-PIPE-003 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → build_call_edges |
| REQ-DDB-PIPE-004 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → python_entry_seeds |
| REQ-DDB-PIPE-005 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → write_build_signature |
| REQ-DDB-PIPE-006 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → run_rustdoc → _require_nightly_rustdoc → clean_subprocess_env |
| REQ-DDB-PIPE-007 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_kconfig_gates |
| REQ-DDB-PIPE-008 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_file_docs |
| REQ-DDB-PIPE-009 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → prune_dominated_fuzzy_call_edges |
| REQ-DDB-PIPE-010 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_shared_key_edges_inferred → _build_inferred_edges |
| REQ-DDB-PIPE-011 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_ast_includes → run_harvest → _harvest_one_file → _parseable_file |
| REQ-DDB-PIPE-012 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → build_harvest_plan → js_symbol_harvester |
| REQ-DDB-PIPE-013 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_python_docstrings |
| REQ-DDB-PIPE-014 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_kerneldoc → within_repo |
| REQ-DDB-PIPE-015 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_config_defaults |
| REQ-DDB-QUERY-003 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → mark_test_scope |
| REQ-DDB-QUERY-011 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → extract_threads → _ensure_threads_tables |
| REQ-DDB-SCHEMA-001 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → extract_threads |
| REQ-DDB-SCHEMA-002 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_shared_key_edges_inferred → _writer_dispatch_map |
| REQ-DDB-SCHEMA-003 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_callback_registration_edges → _ensure_external_boundaries_table |
| REQ-DDB-SCHEMA-004 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → load_dispatch_manifest |
| REQ-DDB-SCHEMA-005 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → resolve_key_alias_prefixes |
| REQ-DDB-SCHEMA-006 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_requirements_yaml |
| REQ-DDB-SCHEMA-007 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_callback_registration_edges → _ensure_external_boundaries_table |
| REQ-DDB-SCHEMA-009 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_event_edges |
| REQ-DDB-SCHEMA-011 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → extract_context_conflicts |
| REQ-DDB-SCHEMA-012 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → load_dispatch_manifest → declaration_origin |
| REQ-DDB-SCHEMA-013 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_data_model_keys |
| REQ-DDB-SCHEMA-014 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_file_docs → ensure_file_docs_table |
| REQ-DDB-SCHEMA-015 | measured | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_requirements_yaml |
| REQ-DDB-WIKI-054 | inferred | test_a_local_handle_is_ended_only_in_its_own_function → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → recover_ast_symbols → _recover_into → all |
Source · 10 lines
def test_a_local_handle_is_ended_only_in_its_own_function(tmp_path: Path) -> None:
"""FOUND MEASURING clew's own tree: a `child` killed in one test was credited with another
test's `child.join()`. A local (a Python name, a C++ declaration at the spawn) is matched only
inside the spawning function; a member (`worker_ =`, `self._t`) anywhere in the file.
@brief Local handles stay local.
"""
assert _threads(tmp_path)[("w.py", 21)] == ("unknown", None)
Activity · 1 steps
test_each_spawn_records_how_it_ends
None test_thread_lifecycle.test_each_spawn_records_how_it_ends(Path tmp_path)
Joined, detached, daemon and unknown, each with the line that says so.
tests/test_thread_lifecycle.py:105
Checks
assert threads[("s.cpp", 14)] == ("joined", 20), "worker_ joined in S::stop"assert threads[("s.cpp", 15)] == ("detached", 15), "chained .detach()"assert threads[("s.cpp", 16)] == ("unknown", None), "a handle nobody joins or detaches"assert threads[("s.cpp", 17)] == ("joined", 17), "std::jthread joins itself"assert threads[("s.cpp", 25)] == ("detached", 26), "pthread_detach(tid)"assert threads[("w.py", 13)] == ("daemon", 13), "Python daemon=True"assert threads[("w.py", 14)] == ("joined", 16), "Python t.join()"
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CLI-001 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → report_stats |
| REQ-DDB-CLI-002 | inferred | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → _doxygen_or_partial → _doxygen_stage → _run_doxygen_from_args → run_doxygen → doxygen_supports_sqlite3 |
| REQ-DDB-CONFIG-001 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _apply_declared_document → stated_document_meta |
| REQ-DDB-CONFIG-003 | inferred | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_requirements_yaml → _is_flat_req_list |
| REQ-DDB-CONFIG-004 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → resolve_preprocessor |
| REQ-DDB-CONFIG-005 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_kconfig |
| REQ-DDB-CONFIG-006 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _recorded_entry_patterns → recorded_explicit |
| REQ-DDB-CONFIG-007 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → write_build_signature |
| REQ-DDB-CONFIG-009 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _apply_toolchain_exclusions → load_toolchain_config |
| REQ-DDB-GUARD-012 | inferred | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → load_guard_config → read_guard_config → read_requirements_section |
| REQ-DDB-GUARD-019 | inferred | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_python_docstrings → summarize → parse_doxygen_tags |
| REQ-DDB-GUARD-024 | inferred | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_python_docstrings → summarize → apply_autobrief |
| REQ-DDB-INDEX-001 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _verify_extra_input_is_read → effective_file_patterns |
| REQ-DDB-INDEX-002 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → build_lock |
| REQ-DDB-INDEX-003 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → report_index_coverage |
| REQ-DDB-INDEX-004 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → recover_ast_symbols |
| REQ-DDB-INDEX-005 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → stamp_external_provenance |
| REQ-DDB-INDEX-006 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → record_code_text → code_text_rows |
| REQ-DDB-INDEX-007 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → record_owners |
| REQ-DDB-INDEX-008 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_file_licenses |
| REQ-DDB-INDEX-009 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_kerneldoc |
| REQ-DDB-INDEX-010 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_ast_includes |
| REQ-DDB-INDEX-011 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_property_keys |
| REQ-DDB-MCP-001 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _operator_excludes → meta_section |
| REQ-DDB-MCP-004 | measured | |
| REQ-DDB-PIPE-001 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_database |
| REQ-DDB-PIPE-003 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → build_call_edges |
| REQ-DDB-PIPE-004 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → python_entry_seeds |
| REQ-DDB-PIPE-005 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → write_build_signature |
| REQ-DDB-PIPE-006 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → run_rustdoc → _require_nightly_rustdoc → clean_subprocess_env |
| REQ-DDB-PIPE-007 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_kconfig_gates |
| REQ-DDB-PIPE-008 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_file_docs |
| REQ-DDB-PIPE-009 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → prune_dominated_fuzzy_call_edges |
| REQ-DDB-PIPE-010 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_shared_key_edges_inferred → _build_inferred_edges |
| REQ-DDB-PIPE-011 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_ast_includes → run_harvest → _harvest_one_file → _parseable_file |
| REQ-DDB-PIPE-012 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → build_harvest_plan → js_symbol_harvester |
| REQ-DDB-PIPE-013 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_python_docstrings |
| REQ-DDB-PIPE-014 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_kerneldoc → within_repo |
| REQ-DDB-PIPE-015 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_config_defaults |
| REQ-DDB-QUERY-003 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → mark_test_scope |
| REQ-DDB-QUERY-011 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → extract_threads → _ensure_threads_tables |
| REQ-DDB-SCHEMA-001 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → extract_threads |
| REQ-DDB-SCHEMA-002 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_shared_key_edges_inferred → _writer_dispatch_map |
| REQ-DDB-SCHEMA-003 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_callback_registration_edges → _ensure_external_boundaries_table |
| REQ-DDB-SCHEMA-004 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → load_dispatch_manifest |
| REQ-DDB-SCHEMA-005 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → resolve_key_alias_prefixes |
| REQ-DDB-SCHEMA-006 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_requirements_yaml |
| REQ-DDB-SCHEMA-007 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_callback_registration_edges → _ensure_external_boundaries_table |
| REQ-DDB-SCHEMA-009 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_event_edges |
| REQ-DDB-SCHEMA-011 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → extract_context_conflicts |
| REQ-DDB-SCHEMA-012 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → load_dispatch_manifest → declaration_origin |
| REQ-DDB-SCHEMA-013 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → import_data_model_keys |
| REQ-DDB-SCHEMA-014 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_file_docs → ensure_file_docs_table |
| REQ-DDB-SCHEMA-015 | measured | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_requirements_yaml |
| REQ-DDB-WIKI-054 | inferred | test_each_spawn_records_how_it_ends → _threads → _run_pipeline → _run_pipeline_inner → _build_stages → recover_ast_symbols → _recover_into → all |
Source · 12 lines
def test_each_spawn_records_how_it_ends(tmp_path: Path) -> None:
"""@brief Joined, detached, daemon and unknown, each with the line that says so."""
threads = _threads(tmp_path)
assert threads[("s.cpp", 14)] == ("joined", 20), "worker_ joined in S::stop"
assert threads[("s.cpp", 15)] == ("detached", 15), "chained .detach()"
assert threads[("s.cpp", 16)] == ("unknown", None), "a handle nobody joins or detaches"
assert threads[("s.cpp", 17)] == ("joined", 17), "std::jthread joins itself"
assert threads[("s.cpp", 25)] == ("detached", 26), "pthread_detach(tid)"
assert threads[("w.py", 13)] == ("daemon", 13), "Python daemon=True"
assert threads[("w.py", 14)] == ("joined", 16), "Python t.join()"