veyron/lib/testutil/blackbox: various measures to prevent process leaks.
Add two measures to prevent child process from outliving their parents
in the case where the parent test crashes. This is a belt+braces approach
to ensure that in the normal case child processes will terminate immediately
when the parent does, but if for whatever reason the parent is hung,
the children will timeout anyway.
1. we don't use SIGHUP since it's often used for reloading configs and
by system launchers such as systemd and launchd.
2. we ensure that the go test timeout parameter is always set, aggressively,
for child processes
3. we open pipe to every child that the child issues blocking read
on and exits when it returns for any reason. Thus, if the parent dies
for whatever reason, the pipe will be closed and the child will terminate.
Change-Id: I38afa23d8ef7cbd477b337d34f1738d4afa22a65
4 files changed