You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test: harden process_unix_test.go ps-availability skips and a vacuous assertion #863
internal/execution/process_unix_test.go has robustness gaps that could let regressions in ps-based zombie detection go unnoticed:
Three tests (TestTerminateProcessTreeTreatsZombieGroupAsExited, TestTerminateProcessTreeStopsRunningGroup's setup implicitly, TestSignalTargetRunningTreatsZombieIndividualPIDAsExited) use t.Skip when ps is unavailable or the process doesn't reach the zombie state in time. ps is present on CI images today, so this doesn't bite currently, but the tests can go quietly green (as skips) if ps parsing or availability ever regresses in CI.
TestTerminateProcessTreeStopsRunningGroup's final assertion:
ifrunning, ok:=processGroupHasRunningMember(pid); ok&&running {
t.Fatal("the group still has a running member after termination")
}
passes vacuously when ok is false (i.e., when ps state couldn't be determined at all) — the same "silently degrades" failure mode as the skips above.
Proposed fix
Consider failing loudly (rather than skipping) when ps is expected to be available (e.g., detect a hard CI environment variable, or simply let these fail instead of skip so a broken ps pipeline surfaces immediately instead of showing as skipped-green).
Change TestTerminateProcessTreeStopsRunningGroup's final assertion to t.Fatal on !ok too, so an undetectable state is treated as a failure rather than silently passing.
Not blocking; ps is available on all CI images used today.
Approved after rechecking current main. The Unix process tests still contain environment skips around ps, and TestTerminateProcessTreeStopsRunningGroup still accepts ok == false through if ok && running, so the final assertion can pass without observing the state it claims to verify. Keep this strictly test-only.
Activity
gnanam1990 commentedon Aug 25, 2026
Approved after rechecking current
main. The Unix process tests still contain environment skips aroundps, andTestTerminateProcessTreeStopsRunningGroupstill acceptsok == falsethroughif ok && running, so the final assertion can pass without observing the state it claims to verify. Keep this strictly test-only.test(execution): fail loudly when ps cannot answer instead of skipping (