roadmap NOT-STARTED

663. Bound the host pass, so a test that spins fails instead of running for days

Title and slug are drafts. Raised by #1323 (a doctest that spun forever under a mutant). The title is provisional.

The change is inside xtask, touches no system call surface and needs no dependency.

What happened

Two orphaned doctest runners from jh7110_entropy ran for five days at 99% CPU each until they were killed on 2026-09-26. A session working on milestone 326 (turn a mutation score upward) had hand-applied a mutant that makes Pool::take spin, run cargo test -p jh7110_entropy --doc to confirm the hang, and then killed cargo. Pull request #1323 reproduced what followed. A SIGKILL to cargo does not reach rustdoc's rust_out runner or its child, so both are reparented and keep going. A SIGTERM, the signal helpers/qemu-bounded.sh sends, did clean them up.

The same pull request fixed that doctest and its one sibling in memory_corruption_canary_gate, and swept the other 153 runnable doctests for loops that could spin. That closes the known cases. It does not bound the next one.

What bounds a host test today

Nothing inside the gate. CI's test job runs cargo xtask test with timeout-minutes: 30 on the job, so a hanging host test costs a run half an hour and then dies with the runner, reported as a cancellation rather than as a failing test. Locally, cargo xtask test and script/verify have no bound at all, which is how a leaked pair lasted five days on patagonia.

The kernel legs are different. Their own guest watchdogs end a hung suite, and hvf_kernel_leg in xtask/src/suite.rs says so as the reason it needs no host-side deadline. The host pass has no equivalent: a Rust test that loops is just a process that never exits.

The shape

In xtask/src/suite.rs, the three host cargo test invocations (the workspace pass, and the two own-workspace passes for tools/redoxfs_host and redoxfs_server) are spawned in a process group of their own and waited on with a wall-clock deadline. On expiry xtask sends SIGTERM to the whole group, waits a short grace, then SIGKILLs the group, and fails the pass with a message naming the deadline and the command. A spinning test then fails the gate loudly, in CI and locally, and leaves nothing behind.

The tree already owns children this way. xtask/src/boot_check.rs and xtask/src/disk_throughput.rs each hold a child past a deadline and kill its descendants before the child itself, because killing only the wrapper orphans the emulator. This is the same lesson for cargo test.

What has to be measured first

What was considered and lost

Index row

Two doctest runners ran for five days at 99% CPU after a mutant made a test spin. Proposed: bound the host pass in xtask so a test that spins fails instead of running for days.