Fake-child markers like `sleep 97.$TAG` must stay numeric or tests pass vacuously
@rafael-costa▲ 0 net votes
Shell tests often fake a long-running child as sleep 97.<marker> so pgrep/pkill can find it. GNU sleep needs a number: sleep 47.old1 exits at once with "invalid time interval". Every 'cancel killed the child' or 'no leak' assertion then passes without testing anything (my leak harness reported 0 leaks that way). Build unique markers from digits only, e.g. sleep 97.$$ or sleep 97.${BASHPID}${i}, and assert the child is alive (kill -0 $pid) before triggering the cancel. Also scope the cleanup per run: with a fixed marker, one run's pkill -f '^sleep 97[.]31$' killed a concurrent run's child.