onsi / ginkgo

A Modern Testing Framework for Go
http://onsi.github.io/ginkgo/
MIT License
8.28k stars 654 forks source link

Ginkgo cli is not forwarding sigterm/sigint signals to its child process. #720

Open pprasanthi opened 4 years ago

pprasanthi commented 4 years ago

If I use Ginkgo precompiled-tests we get 2 process, where ginkgo will be parent process and tests will be child process.

164 root 0:00 ginkgo tests/tests.test 172 root 0:00 /go/src/cd.splunkdev.com/integration-tests/search/tests/tests.test --test.timeout=24h0m0s --ginkgo.seed=1600482244 --ginkgo.slowSpecThreshold=5.00000 PPID is 164 PID is 172

When kubernetes pod running this ginkgo process is killed. It is not passing the SIGNAL to the child process. So the container is exiting with successful code which is not expected. Because containers exitCode will decide if the process running inside it is success or not, and an incomplete run is not a successful run.

onsi commented 1 year ago

sorry for never getting back to this. yes you do need to send the signal to the process and its children yourself. I don't think I can forward it as on the command line sending a signal interactively signals the whole process tree. Is there a way for ginkgo to detect that the entire process tree is being signaled and avoid signaling the child in that case? I'm not sure...