bread/breadd/tests
Breadway 50ff425d2a
All checks were successful
dev release / build (push) Successful in 1m3s
Fix test harness process leak: graceful SIGTERM shutdown + disable podman adapter in test fixtures
The integration test harness (ipc_integration.rs and
module_host_sandbox.rs) tore down spawned breadd instances via
Child::kill() (SIGKILL). Since breadd's PodmanAdapter is enabled by
default and the test breadd.toml fixtures didn't disable it, every
test-spawned daemon on a machine with podman installed ran a real
`podman events --format json` child. SIGKILL gives breadd zero chance
to run its own graceful shutdown path (wait_for_shutdown -> adapter
tasks dropping -> kill_on_drop firing on that child), so it was
orphaned and reparented to init on every single test run instead.

A day of repeated `cargo test --workspace` runs during today's
workstream development left 1,559 such orphaned processes consuming
76.8GB of RSS system-wide, found and cleaned up separately.

Fix is two-layered: disable the podman adapter in both harnesses'
breadd.toml fixtures (tests don't need real container-lifecycle
watching, matching how hyprland/udev/power/network are already
disabled there), and change TestHarness::drop to send SIGTERM with a
bounded wait before falling back to SIGKILL, so breadd's own cleanup
gets a real chance to run - defense in depth against any future
adapter that spawns a subprocess.

Verified: two full `cargo test --workspace` runs (282 tests) produce
zero new podman events processes and zero leftover breadd/
bread-module-host processes.
2026-08-05 06:45:20 +08:00
..
ipc_integration.rs Fix test harness process leak: graceful SIGTERM shutdown + disable podman adapter in test fixtures 2026-08-05 06:45:20 +08:00
module_host_sandbox.rs Fix test harness process leak: graceful SIGTERM shutdown + disable podman adapter in test fixtures 2026-08-05 06:45:20 +08:00