fix: process tree tests — zombie handling for Docker CI containers #14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development-fix-ci"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes the
03_process_treeintegration tests (both bash and Rhai) that were failing in CI but passing locally. The root cause was zombie process detection in Docker containers that lack a proper init system.Problem
In our CI Docker containers, PID 1 is
tail -f /dev/null— not a proper init process. When zinit stops a service and kills its process group, orphaned child processes receive the signal and terminate, but PID 1 never callswait()to reap them. They become zombies (stateZ) re-parented to PID 1.The tests used
ps -p $PIDto verify the child was killed, butps -preports zombies as existing processes — causing a false "still alive" assertion failure.A secondary issue was using
pgrep -f "sleep 200"for process discovery, which is fragile in CI environments where stale processes from previous runs or other containers may match.Changes
tests/scripts/03_process_tree.shpgrep -ffor reliable child PID discoveryps -pwith/proc/PID/statusstate check — zombies (Z) and dead processes (X) are correctly treated as terminatedtests/rhai/03_process_tree.rhai/proc/PID/statuszombie detection as the bash versionzinit_delete()cleanup call (consistent with other Rhai tests; also avoids a name normalization inconsistency in thezinit_deleteglobal function)src/server/process.rsfind_processes_on_portsthat still referenced a removed netstat fallback.forgejo/workflows/test.yamldevelopment-fix-cibranch from trigger listTesting
development-fix-cibranch passes: all tests greenRelated
Builds on the earlier CI fixes already merged to
development:e8b3c0e— cmdline filter fix + separate test/publish workflows0237513—find_processes_on_portssocket inode rewrite