:bug: ensure envtest stops the whole process group
A previous pull request attempted to prevent envtest from leaking orphaned etcd / kube-apiserver etc. processes by adding a SysProcAttr of `Setpgid: true`. However, it made a few mistakes: - It incorrectly described the change as causing the process to "inherit the parent's process group id", which is the opposite of what it does. In fact it causes a brand new process group to be created for the child process, which is the actual behaviour we want, so correct the comment. - Whilst it added a new process group, it didn't update the signalling to send SIGTERM (and eventually SIGKILL) to the process group (by using a `-` prefix) and was still just sending the signal to the process itself. - It didn't add a unittest to assert on the desired behaviour before and after the changes. This PR should hopefully fix all of those problems and result in fewer process leaks. Signed-off-by: Dominic Evans <dominic.evans@uk.ibm.com>
D
Dominic Evans committed
6c7ba77a79f3a279160210303e6d3f3f114f5941
Parent: 8ebd0ff