Files
codebase-memory-mcp/tests
Martin Vogel 33ae8f382e test(subprocess): prove descendant memory is measured on every platform
subprocess_tree_rss_measures_contained_descendants asserted only that the
tree total was above zero, which the root alone satisfies, and it was
skipped on Windows although its skip text said it ran there.

The test runner gains two roles: __cbm_rss_tree_root starts one
__cbm_rss_tree_hold descendant (fork on POSIX, CreateProcessW into the same
Job Object on Windows) that touches a controlled allocation and publishes its
pid by an atomic rename. The test measures two otherwise identical trees, one
whose descendant holds nothing and one whose descendant holds 128 MiB, and
requires the second total to be at least 96 MiB higher. Only a probe that
measures past the root can pass. The test now runs natively on Windows.

The waits have no deadline: they end when the descendant is ready or the
tree stops running, and the root exits when its descendant dies.

Binding check: with the macOS probe reduced to the root only, the test fails
(the loaded tree is not 96 MiB above the idle one). GREEN on the real probe
(idle 43 MiB, loaded 187 MiB under ASan).

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-02 00:16:48 +01:00
..
…
2026-10-11 16:57:48 +02:00